mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-26 17:45:52 +01:00
Switch file ops to stdio
- Does away with the O_BINARY abomination - as a byproduct, plugs an fd leak in wcolorpanel.c:fetchFile() - sprinkle some fsync()s to files that have been written to (this needs to be done everywhere) + fix brown paper bag thinko in configure.ac
This commit is contained in:
committed by
Carlos R. Mafra
parent
ea4645bc09
commit
71aa4f2884
@@ -402,6 +402,7 @@ static void dumpRImage(char *path, RImage * image)
|
||||
|
||||
fwrite(image->data, 1, image->width * image->height * channels, f);
|
||||
|
||||
fsync(fileno(f));
|
||||
if (fclose(f) < 0) {
|
||||
wsyserror(path);
|
||||
}
|
||||
|
||||
@@ -699,6 +699,7 @@ static void storeCommandInScript(char *cmd, char *line)
|
||||
fputs(line, fo);
|
||||
fputs("\n", fo);
|
||||
}
|
||||
fsync(fileno(fo));
|
||||
fclose(fo);
|
||||
|
||||
if (rename(tmppath, path) != 0) {
|
||||
@@ -711,8 +712,10 @@ static void storeCommandInScript(char *cmd, char *line)
|
||||
|
||||
end:
|
||||
wfree(path);
|
||||
if (f)
|
||||
if (f) {
|
||||
fsync(fileno(f)); /* this may be rw */
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
static void storeData(_Panel * panel)
|
||||
|
||||
Reference in New Issue
Block a user