Skip to content

Commit

Permalink
Freeze workaround (#53)
Browse files Browse the repository at this point in the history
* O_NONBLOCK for 'open' as workaround for freezing

* fixed double free bug on macOS
  • Loading branch information
dm0123 authored Mar 28, 2022
1 parent 9505eb2 commit be43744
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/afsctool.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ void compressFile(const char *inFile, struct stat *inFileInfo, struct folder_inf
}
#endif
// use open() with an exclusive lock so noone can modify the file while we're at it
fdIn = open(inFile, O_RDWR|O_EXLOCK);
fdIn = open(inFile, O_RDWR|O_EXLOCK|O_NONBLOCK);
if (fdIn == -1)
{
fprintf(stderr, "%s: %s\n", inFile, strerror(errno));
Expand Down Expand Up @@ -2277,7 +2277,6 @@ void process_folder(FTS *currfolder, struct folder_info *folderinfo)
if (xattrsize < 0)
{
fprintf(stderr, "getxattr: %s\n", strerror(errno));
free(xattrnames);
continue;
}
numxattrs++;
Expand Down

0 comments on commit be43744

Please sign in to comment.