Skip to content

Commit 281140e

Browse files
author
Rainer Keller
committed
Fix compile warnings
Change-Id: I05fb9bca47f5bcfc3f127eb9a60e6be8bda8193a Reviewed-by: Ulf Hermann <[email protected]>
1 parent 9188249 commit 281140e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ int main(int argc, char **argv)
433433
}
434434

435435
setsid();
436-
chdir("/");
436+
if (chdir("/") != 0)
437+
return -1;
437438
signal(SIGHUP, SIG_IGN);
438439

439440
// child

process.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ void Process::forwardProcessOutput(qintptr fd, const QByteArray &data)
129129
fd_set inputFdSet;
130130
FD_ZERO(&inputFdSet);
131131
FD_SET(pipefd[0], &inputFdSet);
132-
if (select(qMax(fd, pipefd[0]) + 1, &inputFdSet, &outputFdSet, NULL, NULL) > 0 &&
133-
!FD_ISSET(pipefd[0], &inputFdSet))
132+
if (select(qMax(fd, static_cast<qintptr>(pipefd[0])) + 1,
133+
&inputFdSet, &outputFdSet, NULL, NULL) > 0 &&
134+
!FD_ISSET(pipefd[0], &inputFdSet))
134135
continue;
135136
// else fprintf below will output the appropriate errno
136137
}

0 commit comments

Comments
 (0)