diff --git a/lsyncd.c b/lsyncd.c index d5e0821..816f23c 100644 --- a/lsyncd.c +++ b/lsyncd.c @@ -755,9 +755,16 @@ write_pidfile snprintf( buf, sizeof( buf ), "%i\n", getpid( ) ); - write( pidfile_fd, buf, strlen( buf ) ); + if (write( pidfile_fd, buf, strlen( buf ) ) != strlen(buf)) { + printlogf( + L, "Error", + "Cannot write pidfile; '%s'", + pidfile + ); + + safeexit(L, -1 ); + } - //fclose( f ); }