File xibod.dif of Package xibod

Index: xibod/stubs.c
===================================================================
--- xibod.orig/stubs.c
+++ xibod/stubs.c
@@ -59,15 +59,15 @@ static void update_indicators(int n);
 void quit (Widget w, XtPointer client_data,
            XmPushButtonCallbackStruct *call_data)
 {
-    int cmd;
+    int cmd, ret = 0;
         
     if (sd > -1) {
        cmd = CMD_CLOSE;
-       write(sd, &cmd, sizeof(int));
+       ret = write(sd, &cmd, sizeof(int));
        close(sd);
        sd = -1;
     }
-    exit(0);
+    exit(ret);
 }
 
 /*
@@ -135,7 +135,10 @@ void open_connection (Widget w, XtPointe
 
     XmStringFree(ls);
 
-    write(sd, &cmd, sizeof(OpenCMD_t));
+    if (write(sd, &cmd, sizeof(OpenCMD_t)) <0) {
+    	perror("xibod: open");
+    	exit(1);
+    }
 
     XtUnmanageChild(open_dialog_w->dialog_container_w);
     XtSetSensitive(toplevel_w->open_button_w, TRUE);
@@ -172,7 +175,7 @@ static void read_rate(Widget w, XtPointe
 void 
 close_connection (Widget w, XtPointer client_data, XtPointer xt_call_data )
 {
-    int  cmd;
+    int  cmd, ret;
     XmString ls;
     XmPushButtonCallbackStruct *call_data =
         (XmPushButtonCallbackStruct *) xt_call_data;
@@ -180,7 +183,7 @@ close_connection (Widget w, XtPointer cl
     XtRemoveInput(input_id);
     if (sd > -1) {
        cmd = CMD_CLOSE;
-       write(sd, &cmd, sizeof(int));
+       ret = write(sd, &cmd, sizeof(int));
        close(sd);
        sd = -1;
     }
@@ -258,9 +261,9 @@ up2 (Widget w, XtPointer client_data, Xt
 {
     XmPushButtonCallbackStruct *call_data = (XmPushButtonCallbackStruct *) xt_call_data;
 
-    int cmd = CMD_UP2;
+    int cmd = CMD_UP2, ret;
 
-    write(sd, &cmd, sizeof(int));
+    ret = write(sd, &cmd, sizeof(int));
 }
 
 /*
@@ -272,9 +275,9 @@ down2 (Widget w, XtPointer client_data, 
 {
     XmPushButtonCallbackStruct *call_data = (XmPushButtonCallbackStruct *) xt_call_data;
 
-    int cmd = CMD_DOWN2;
+    int cmd = CMD_DOWN2, ret;
 
-    write(sd, &cmd, sizeof(int));
+    ret = write(sd, &cmd, sizeof(int));
 }
 
 /*
@@ -285,13 +288,13 @@ void 
 enable (Widget w, XtPointer client_data, XtPointer xt_call_data )
 {
     XmToggleButtonCallbackStruct *call_data = (XmToggleButtonCallbackStruct *) xt_call_data;
-    int  cmd;
+    int  cmd, ret;
 
     if (call_data->set == True)
         cmd = CMD_ENABLE;
     else
         cmd = CMD_DISABLE;
 
-    write(sd, &cmd, sizeof(int));
+    ret = write(sd, &cmd, sizeof(int));
 }
 
Index: xibod/xibod.c
===================================================================
--- xibod.orig/xibod.c
+++ xibod/xibod.c
@@ -27,7 +27,7 @@
 #include <Xm/ToggleB.h>
 #include <Xm/SeparatoG.h>
 #include <stdio.h>
-
+#include <stdlib.h>
 
 typedef struct reopen_warning_w_s {
 	Widget reopen_warning_w;