Skip to content

Commit be43744

Browse files
authored
Freeze workaround (#53)
* O_NONBLOCK for 'open' as workaround for freezing * fixed double free bug on macOS
1 parent 9505eb2 commit be43744

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/afsctool.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ void compressFile(const char *inFile, struct stat *inFileInfo, struct folder_inf
479479
}
480480
#endif
481481
// use open() with an exclusive lock so noone can modify the file while we're at it
482-
fdIn = open(inFile, O_RDWR|O_EXLOCK);
482+
fdIn = open(inFile, O_RDWR|O_EXLOCK|O_NONBLOCK);
483483
if (fdIn == -1)
484484
{
485485
fprintf(stderr, "%s: %s\n", inFile, strerror(errno));
@@ -2277,7 +2277,6 @@ void process_folder(FTS *currfolder, struct folder_info *folderinfo)
22772277
if (xattrsize < 0)
22782278
{
22792279
fprintf(stderr, "getxattr: %s\n", strerror(errno));
2280-
free(xattrnames);
22812280
continue;
22822281
}
22832282
numxattrs++;

0 commit comments

Comments
 (0)