Check ftruncate return value
Fixes build warning on Debian jessie
@@ -1788,7 +1788,11 @@ int main(
if(mypid > 0){
/* Record pid. */
- ftruncate(pid_fd, 0);
+ if (ftruncate(pid_fd, 0) != 0) {
+ I2ErrLogP(errhand, errno, "ftruncate: %M");
+ kill(mypid,SIGTERM);
+ exit(1);
+ }
fprintf(pid_fp, "%lld\n", (long long)mypid);
if (fflush(pid_fp) < 0) {
I2ErrLogP(errhand, errno, "fflush: %M");
