libadmin: read returns an ssize_t, not a size_t
[openafs.git] / src / libadmin / bos / afs_bosAdmin.c
index d80ed32..cbcf1df 100644 (file)
@@ -9,30 +9,21 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
+#include <roken.h>
 
-#include <stdio.h>
-#include <afs/stds.h>
 #include <rx/rx.h>
 #include <rx/rxstat.h>
-#include "afs_bosAdmin.h"
-#include "../adminutil/afs_AdminInternal.h"
 #include <afs/afs_AdminErrors.h>
 #include <afs/afs_utilAdmin.h>
 #include <afs/bosint.h>
 #include <afs/bnode.h>
 #include <afs/ktime.h>
 #include <afs/dirpath.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#ifdef AFS_NT40_ENV
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-#include <string.h>
+
+#include "afs_bosAdmin.h"
+#include "../adminutil/afs_AdminInternal.h"
 
 typedef struct bos_server {
     int begin_magic;
@@ -2714,7 +2705,7 @@ bos_ExecutableCreate(const void *serverHandle, const char *sourceFile,
 
     while (1) {
        char tbuffer[512];
-       size_t len;
+       ssize_t len;
        len = read(fd, tbuffer, sizeof(tbuffer));
        if (len < 0) {
            tst = ADMBOSCANTREADSOURCEFILE;
@@ -2824,8 +2815,8 @@ bos_ExecutableRevert(const void *serverHandle, const char *execFile,
 
 int ADMINAPI
 bos_ExecutableTimestampGet(const void *serverHandle, const char *execFile,
-                          unsigned long *newTime, unsigned long *oldTime,
-                          unsigned long *bakTime, afs_status_p st)
+                          afs_int32 *newTime, afs_int32 *oldTime,
+                          afs_int32 *bakTime, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2964,7 +2955,7 @@ bos_ExecutableRestartTimeSet(const void *serverHandle, bos_Restart_t type,
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 restartType = 0;
-    struct ktime restartTime;
+    struct bozo_netKTime restartTime;
 
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ExecutableRestartTimeSet;
@@ -3050,7 +3041,7 @@ bos_ExecutableRestartTimeGet(const void *serverHandle, bos_Restart_t type,
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 restartType = 0;
-    struct ktime restartTime;
+    struct bozo_netKTime restartTime;
 
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ExecutableRestartTimeGet;
@@ -3154,7 +3145,7 @@ bos_LogGet(const void *serverHandle, const char *log,
 
     tcall = rx_NewCall(b_handle->server);
     have_call = 1;
-    tst = StartBOZO_GetLog(tcall, log);
+    tst = StartBOZO_GetLog(tcall, (char *) log);
 
     if (tst != 0) {
        goto fail_bos_LogGet;
@@ -3295,7 +3286,7 @@ bos_CommandExecute(const void *serverHandle, const char *command,
        goto fail_bos_CommandExecute;
     }
 
-    tst = BOZO_Exec(b_handle->server, command);
+    tst = BOZO_Exec(b_handle->server, (char *) command);
 
     if (tst == 0) {
        rc = 1;