mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Use raw functions instead of file functions
This commit is contained in:
parent
a007fe8493
commit
745a30ccb5
|
@ -1377,12 +1377,12 @@ static void writesel(const char *buf, const size_t buflen)
|
||||||
if (!selpath)
|
if (!selpath)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FILE *fp = fopen(selpath, "w");
|
int fd = open(selpath, O_CREAT | O_WRONLY | O_TRUNC, 0666);
|
||||||
|
|
||||||
if (fp) {
|
if (fd != -1) {
|
||||||
if (fwrite(buf, 1, buflen, fp) != buflen)
|
if (write(fd, buf, buflen) != (ssize_t)buflen)
|
||||||
printwarn(NULL);
|
printwarn(NULL);
|
||||||
fclose(fp);
|
close(fd);
|
||||||
} else
|
} else
|
||||||
printwarn(NULL);
|
printwarn(NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue