From: Frederic Marchal Date: Sun, 26 Apr 2015 11:32:06 +0000 (+0200) Subject: Merge messages X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f02fbd9294b843944e8aed6a1f0b155d9bb48c70;p=thirdparty%2Fsarg.git Merge messages These messages are related to file manipulation. --- diff --git a/exclude.c b/exclude.c index cc6aa44..98e39d2 100644 --- a/exclude.c +++ b/exclude.c @@ -322,7 +322,7 @@ void getuexclude(const char *uexfile, int debug) } if (fseek(fp_ex, 0, SEEK_END)==-1) { - debuga(_("Failed to move till the end of the excluded users file %s: %s\n"),uexfile,strerror(errno)); + debuga(_("Failed to move till the end of file \"%s\": %s\n"),uexfile,strerror(errno)); exit(EXIT_FAILURE); } nreg = ftell(fp_ex); @@ -332,7 +332,7 @@ void getuexclude(const char *uexfile, int debug) } nreg += 11; if (fseek(fp_ex, 0, SEEK_SET)==-1) { - debuga(_("Failed to rewind the excluded users file %s: %s\n"),uexfile,strerror(errno)); + debuga(_("Failed to rewind file \"%s\": %s\n"),uexfile,strerror(errno)); exit(EXIT_FAILURE); } diff --git a/index.c b/index.c index 46d1139..3075b1a 100644 --- a/index.c +++ b/index.c @@ -167,7 +167,7 @@ static long long int get_size(char *path,int path_size) } strcpy(path+path_len,direntp->d_name); if (MY_LSTAT(path,&statb) == -1) { - debuga(_("Failed to get the file statistics of %s: %s\n"),path,strerror(errno)); + debuga(_("Failed to get the statistics of file \"%s\": %s\n"),path,strerror(errno)); continue; } if (S_ISDIR(statb.st_mode)) @@ -266,7 +266,7 @@ static long long int make_date_index_day(char *monthdir,int monthdir_size,int or } strcpy(monthdir+monthdir_len,direntp->d_name); if (MY_LSTAT(monthdir,&statb) == -1) { - debuga(_("Failed to get the file statistics of %s: %s\n"),monthdir,strerror(errno)); + debuga(_("Failed to get the statistics of file \"%s\": %s\n"),monthdir,strerror(errno)); continue; } if (S_ISDIR(statb.st_mode)) @@ -426,7 +426,7 @@ static long long int make_date_index_month(char *yeardir,int yeardir_size,int or } strcpy(yeardir+yeardir_len,direntp->d_name); if (MY_LSTAT(yeardir,&statb) == -1) { - debuga(_("Failed to get the file statistics of %s: %s\n"),yeardir,strerror(errno)); + debuga(_("Failed to get the statistics of file \"%s\": %s\n"),yeardir,strerror(errno)); continue; } if (S_ISDIR(statb.st_mode)) diff --git a/lastlog.c b/lastlog.c index 7e17407..5c6f9d3 100644 --- a/lastlog.c +++ b/lastlog.c @@ -105,7 +105,7 @@ static struct DirEntry *BuildDirDateList(struct DirEntry *List,char *Path,int Pa } strcpy(Path+Length,direntp->d_name); if (stat(Path,&statb) == -1) { - debuga(_("Failed to get the last modification time of %s\n"),Path); + debuga(_("Failed to get the statistics of file \"%s\": %s\n"),Path,strerror(errno)); continue; } if (!S_ISDIR(statb.st_mode)) continue; @@ -170,7 +170,7 @@ static struct DirEntry *BuildDirList(const char *Path) } strcpy(warea+name_pos,direntp->d_name); if (stat(warea,&statb) == -1) { - debuga(_("Failed to get the last modification time of %s\n"),warea); + debuga(_("Failed to get the statistics of file \"%s\": %s\n"),warea,strerror(errno)); continue; } if (!S_ISDIR(statb.st_mode)) continue; @@ -240,8 +240,7 @@ static void DeleteEmptyDirs(char *Path,int PathSize,int BasePos) } strcat(Path,"/"INDEX_HTML_FILE); if (unlink(Path)==-1) { - // TRANSLATORS: The %s at the end is the system error message describing the reason for the failure. - debuga(_("Failed to delete index file \"%s\" in the empty report directory: %s\n"),Path,strerror(errno)); + debuga(_("Failed to delete \"%s\": %s\n"),Path,strerror(errno)); exit(EXIT_FAILURE); } *Dir='\0'; diff --git a/log.c b/log.c index 05cf18d..7eb46da 100644 --- a/log.c +++ b/log.c @@ -765,7 +765,7 @@ static void getusers(const char *pwdfile, int debug) } if (fseek(fp_usr, 0, SEEK_END)==-1) { - debuga(_("Failed to move till the end of the users file %s: %s\n"),pwdfile,strerror(errno)); + debuga(_("Failed to move till the end of file \"%s\": %s\n"),pwdfile,strerror(errno)); exit(EXIT_FAILURE); } nreg = ftell(fp_usr); @@ -775,7 +775,7 @@ static void getusers(const char *pwdfile, int debug) } nreg = nreg+5000; if (fseek(fp_usr, 0, SEEK_SET)==-1) { - debuga(_("Failed to rewind the users file %s: %s\n"),pwdfile,strerror(errno)); + debuga(_("Failed to rewind file \"%s\": %s\n"),pwdfile,strerror(errno)); exit(EXIT_FAILURE); } diff --git a/realtime.c b/realtime.c index 0d2cf2a..975d71e 100644 --- a/realtime.c +++ b/realtime.c @@ -215,7 +215,7 @@ void realtime(void) } fp = fopen(file_name, "r"); if (!fp) { - debuga(_("Failed to open the last modified log file \"%s\": %s\n"),file_name,strerror(errno)); + debuga(_("Cannot open file \"%s\": %s\n"),file_name,strerror(errno)); exit(EXIT_FAILURE); } while((buf=longline_read(fp,line)) != NULL ) diff --git a/usertab.c b/usertab.c index 12af3d7..03934e3 100644 --- a/usertab.c +++ b/usertab.c @@ -80,7 +80,7 @@ static void init_file_usertab(const char *UserTabFile) exit(EXIT_FAILURE); } if (fseek(fp_usr, 0, SEEK_END)==-1) { - debuga(_("Failed to move till the end of the usertab file %s: %s\n"),UserTabFile,strerror(errno)); + debuga(_("Failed to move till the end of file \"%s\": %s\n"),UserTabFile,strerror(errno)); exit(EXIT_FAILURE); } nreg = ftell(fp_usr); @@ -90,7 +90,7 @@ static void init_file_usertab(const char *UserTabFile) } nreg += 100; if (fseek(fp_usr, 0, SEEK_SET)==-1) { - debuga(_("Failed to rewind the usertab file %s: %s\n"),UserTabFile,strerror(errno)); + debuga(_("Failed to rewind file \"%s\": %s\n"),UserTabFile,strerror(errno)); exit(EXIT_FAILURE); } if((userfile=(char *) malloc(nreg))==NULL){ diff --git a/util.c b/util.c index baceb98..86a2cd8 100644 --- a/util.c +++ b/util.c @@ -1759,7 +1759,7 @@ void load_excludecodes(const char *ExcludeCodes) } if (fseek(fp_in, 0, SEEK_END)==-1) { - debuga(_("Failed to move till the end of the excluded codes file %s: %s\n"),ExcludeCodes,strerror(errno)); + debuga(_("Failed to move till the end of file \"%s\": %s\n"),ExcludeCodes,strerror(errno)); exit(EXIT_FAILURE); } MemSize = ftell(fp_in); @@ -1768,7 +1768,7 @@ void load_excludecodes(const char *ExcludeCodes) exit(EXIT_FAILURE); } if (fseek(fp_in, 0, SEEK_SET)==-1) { - debuga(_("Failed to rewind the excluded codes file %s: %s\n"),ExcludeCodes,strerror(errno)); + debuga(_("Failed to rewind file \"%s\": %s\n"),ExcludeCodes,strerror(errno)); exit(EXIT_FAILURE); } @@ -1785,7 +1785,7 @@ void load_excludecodes(const char *ExcludeCodes) for (i=strlen(data)-1 ; i>=0 && (unsigned char)data[i]<=' ' ; i--) data[i]='\0'; if (i<0) continue; if (Stored+i+2>=MemSize) { - debuga(_("Too many codes to exclude in file %s\n"),ExcludeCodes); + debuga(_("Too many codes to exclude in file \"%s\"\n"),ExcludeCodes); break; } strcat(excludecode,data);