tweaks: try chmodding a dump file only when it was actually written
parent
50543300d9
commit
1b5d9171f2
|
@ -327,8 +327,6 @@ void emergency_save(const char *filename)
|
||||||
fprintf(stderr, _("\nToo many .save files\n"));
|
fprintf(stderr, _("\nToo many .save files\n"));
|
||||||
else if (write_file(targetname, NULL, TRUE, OVERWRITE, FALSE)) {
|
else if (write_file(targetname, NULL, TRUE, OVERWRITE, FALSE)) {
|
||||||
fprintf(stderr, _("\nBuffer written to %s\n"), targetname);
|
fprintf(stderr, _("\nBuffer written to %s\n"), targetname);
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Try to chmod/chown the saved file to the values of the original file,
|
/* Try to chmod/chown the saved file to the values of the original file,
|
||||||
* but ignore any failure as we are in a hurry to get out. */
|
* but ignore any failure as we are in a hurry to get out. */
|
||||||
|
@ -338,6 +336,7 @@ void emergency_save(const char *filename)
|
||||||
openfile->statinfo->st_gid));
|
openfile->statinfo->st_gid));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
free(targetname);
|
free(targetname);
|
||||||
free(plainname);
|
free(plainname);
|
||||||
|
|
Loading…
Reference in New Issue