]> andersk Git - moira.git/blobdiff - update/get_file.c
Since pr_ChangeEntry() already checks to see if the id's aren't changing,
[moira.git] / update / get_file.c
index 79baacc7710e1e292993bdd530aa0859a9bfae7c..0f40252f7bad3563cfb8256cb346616cac252f38 100644 (file)
@@ -16,9 +16,13 @@ static char *rcsid_get_file_c = "$Header$";
 #include <ctype.h>
 #include <sys/param.h>
 #include <sys/file.h>
-#include <sms.h>
+#include <moira.h>
 #include "update.h"
 
+#ifndef MIN
+#define MIN(a,b)    (((a) < (b))?(a):(b))
+#endif /* MIN */
+
 extern CONNECTION conn;
 char buf[BUFSIZ];
 
@@ -70,7 +74,7 @@ get_file(pathname, file_size, checksum)
     int found_checksum;
     
     if (!have_authorization) {
-       reject_call(SMS_PERM);
+       reject_call(MR_PERM);
        return(1);
     }
     if (done)                  /* re-initialize data */
@@ -83,7 +87,7 @@ get_file(pathname, file_size, checksum)
        code = errno;
        sprintf(buf, "%s: creating file %s (get_file)",
                error_message(code), pathname);
-       sms_log_error(buf);
+       mr_log_error(buf);
        report_error("reporting file creation error (get_file)");
        return(1);
     }
@@ -96,7 +100,7 @@ get_file(pathname, file_size, checksum)
            code = errno;
            sprintf(buf, "%s: verifying free disk space for %s (get_file)",
                    error_message(code), pathname);
-           sms_log_error(buf);
+           mr_log_error(buf);
            /* do all we can to free the space */
            (void) unlink(pathname);
            (void) ftruncate(fd, 0);
@@ -134,7 +138,7 @@ get_file(pathname, file_size, checksum)
     /* validate checksum */
     found_checksum = checksum_file(pathname);
     if (checksum != found_checksum) {
-       code = SMS_MISSINGFILE;
+       code = MR_MISSINGFILE;
        com_err(whoami, code, ": expected = %d, found = %d",
                checksum, found_checksum);
        report_error("checksum error");
@@ -173,7 +177,7 @@ get_block(fd, max_size)
        if (n_wrote == -1) {
            code = errno;
            sprintf(buf, "%s: writing file (get_file)", error_message(code));
-           sms_log_error(buf);
+           mr_log_error(buf);
            string_free(&data);
            report_error("reporting write error (get_file)");
            close(fd);
This page took 0.053002 seconds and 4 git commands to generate.