1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-02-17 15:45:56 -05:00

Fix compiler warnings. (return value ftrunc/write)

This commit is contained in:
Dave Davenport 2015-02-01 10:03:16 +01:00
parent b74e6b791a
commit 97c11d7d85

View file

@ -47,9 +47,9 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/types.h>
#ifdef HAVE_I3_IPC_H #ifdef HAVE_I3_IPC_H
#include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <linux/un.h> #include <linux/un.h>
#include <i3/ipc.h> #include <i3/ipc.h>
@ -2742,12 +2742,12 @@ static void create_pid_file ( const char *pidfile )
fprintf ( stderr, "%d %s\n", retv, strerror ( errno ) ); fprintf ( stderr, "%d %s\n", retv, strerror ( errno ) );
exit ( 1 ); exit ( 1 );
} }
ftruncate ( fd, (off_t) 0 ); if ( ftruncate ( fd, (off_t) 0 ) == 0 ) {
// Write pid, not needed, but for completeness sake.
// Write pid. char buffer[64];
char buffer[64]; int length = snprintf ( buffer, 64, "%i", getpid () );
int length = snprintf ( buffer, 64, "%i", getpid () ); ssize_t l = write ( fd, buffer, length );
write ( fd, buffer, length ); }
} }
int main ( int argc, char *argv[] ) int main ( int argc, char *argv[] )