mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51: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)
|
||||
return;
|
||||
|
||||
FILE *fp = fopen(selpath, "w");
|
||||
int fd = open(selpath, O_CREAT | O_WRONLY | O_TRUNC, 0666);
|
||||
|
||||
if (fp) {
|
||||
if (fwrite(buf, 1, buflen, fp) != buflen)
|
||||
if (fd != -1) {
|
||||
if (write(fd, buf, buflen) != (ssize_t)buflen)
|
||||
printwarn(NULL);
|
||||
fclose(fp);
|
||||
close(fd);
|
||||
} else
|
||||
printwarn(NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue