* $Source$
* $Header$
*/
+/* (c) Copyright 1988 by the Massachusetts Institute of Technology. */
+/* For copying and distribution information, please see the file */
+/* <mit-copyright.h>. */
#ifndef lint
static char *rcsid_get_file_c = "$Header$";
#endif lint
+#include <mit-copyright.h>
#include <stdio.h>
#include <gdb.h>
#include <ctype.h>
#include <sys/param.h>
#include <sys/file.h>
-#include <sms.h>
+#include <moira.h>
#include "update.h"
-#include "kludge.h"
+
+#ifndef MIN
+#define MIN(a,b) (((a) < (b))?(a):(b))
+#endif /* MIN */
extern CONNECTION conn;
char buf[BUFSIZ];
int found_checksum;
if (!have_authorization) {
- reject_call(SMS_PERM);
+ reject_call(MR_PERM);
return(1);
}
if (done) /* re-initialize data */
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);
}
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);
/* 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");
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);