X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fmake-file.c;h=fdbb4643ebf7bb5e35ad219a81d4ad76f2384440;hb=2d45d41b2bae93062d76d0dc48a025b348631801;hp=f4456ca153aac03218e94120ecf71f212e6ff689;hpb=d6cbbc8d634fa91f050661355139a4e4697e99ab;p=pspp diff --git a/src/data/make-file.c b/src/data/make-file.c index f4456ca153..fdbb4643eb 100644 --- a/src/data/make-file.c +++ b/src/data/make-file.c @@ -19,7 +19,6 @@ #include "data/make-file.h" #include "libpspp/i18n.h" -#include #include #include #include @@ -148,7 +147,7 @@ Trename (TCHAR const *src, TCHAR const *dst) return -1; } -TCHAR * +TCHAR * convert_to_filename_encoding (const char *s, size_t len, const char *current_encoding) { const char *enc = current_encoding; @@ -160,17 +159,16 @@ convert_to_filename_encoding (const char *s, size_t len, const char *current_enc #else -typedef char TCHAR; #define TS_stat stat #define Trename rename #define Tunlink unlink #define Topen open #define Tstat stat -TCHAR * +TCHAR * convert_to_filename_encoding (const char *s, size_t len UNUSED, const char *current_encoding UNUSED) { - /* Non-windows systems don't care about the encoding. + /* Non-windows systems don't care about the encoding. The string is copied here, to be consistent with the w32 case. */ return xstrdup (s); } @@ -187,11 +185,11 @@ struct replace_file char *tmp_name_verbatim; const char *file_name_verbatim; }; - + static struct ll_list all_files = LL_INITIALIZER (all_files); static void free_replace_file (struct replace_file *); -static void unlink_replace_files (void); +static void unlink_replace_files (int sig); struct replace_file * replace_file_start (const struct file_handle *fh, const char *mode, @@ -215,7 +213,7 @@ replace_file_start (const struct file_handle *fh, const char *mode, fd = Topen (Tfile_name, O_WRONLY); if (fd < 0) { - saved_errno = errno; + saved_errno = errno; msg (ME, _("Opening %s for writing: %s."), file_name, strerror (saved_errno)); free (Tfile_name); @@ -226,7 +224,7 @@ replace_file_start (const struct file_handle *fh, const char *mode, *fp = fdopen (fd, mode); if (*fp == NULL) { - saved_errno = errno; + saved_errno = errno; msg (ME, _("Opening stream for %s: %s."), file_name, strerror (saved_errno)); close (fd); @@ -371,7 +369,7 @@ free_replace_file (struct replace_file *rf) } static void -unlink_replace_files (void) +unlink_replace_files (int sig UNUSED) { struct replace_file *rf;