Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions w1/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ CHAN *uChannelCreate (int cMax, int size, AC_HANDLE h0)

pthread_condattr_t cattr;
pthread_condattr_init(&cattr);
#if defined(_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION > 0)
/* not available in Mac */
pthread_condattr_setclock(&cattr, CLOCK_MONOTONIC);
#endif
pthread_cond_init(&(c->c.notFull), &cattr);
pthread_cond_init(&(c->c.notEmpty), &cattr);
pthread_condattr_destroy(&cattr);
Expand Down
5 changes: 5 additions & 0 deletions w1/scratch.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ SCR scratchCreate (const char *dirName, AC_HANDLE h)
scr->blocks = arrayCreate (128, SCR_) ;
if (! dirName || ! *dirName) dirName = "." ;

#ifdef O_TMPFILE
fd = open (dirName, O_TMPFILE | O_RDWR | O_CLOEXEC, 0600) ; /* no O_CREAT, no name */
#else
fd = -1;
#endif

if (fd < 0) /* filesystem without O_TMPFILE: named file, then unlink */
{
char buf[4096] ;
Expand Down
Loading