1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -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/file.h>
#include <sys/types.h>
#ifdef HAVE_I3_IPC_H
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/un.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 ) );
exit ( 1 );
}
ftruncate ( fd, (off_t) 0 );
// Write pid.
char buffer[64];
int length = snprintf ( buffer, 64, "%i", getpid () );
write ( fd, buffer, length );
if ( ftruncate ( fd, (off_t) 0 ) == 0 ) {
// Write pid, not needed, but for completeness sake.
char buffer[64];
int length = snprintf ( buffer, 64, "%i", getpid () );
ssize_t l = write ( fd, buffer, length );
}
}
int main ( int argc, char *argv[] )