diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-18 10:38:49 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-18 10:38:49 -0300 |
commit | 8c653212c0e6d15997e4217a514301f5682a41c4 (patch) | |
tree | 53c72812eebbb69c212183cb77db8051731f63c2 /TraceScreen.c | |
parent | b064d501ae68a20f519064662205905dbe9f9b85 (diff) |
Replace size_t with int/void* union
I was occasionally passing negative values to size_t.
Plus, this better reflects the intent of the variant argument.
Reported by Coverity:
https://scan8.coverity.com/reports.htm#v13253/p10402/fileInstanceId=22093891&defectInstanceId=7543346&mergedDefectId=174179&fileStart=251&fileEnd=500
Diffstat (limited to 'TraceScreen.c')
-rw-r--r-- | TraceScreen.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/TraceScreen.c b/TraceScreen.c index abef7120..845ceaab 100644 --- a/TraceScreen.c +++ b/TraceScreen.c @@ -108,7 +108,8 @@ bool TraceScreen_forkTracer(TraceScreen* this) { (void) written; exit(1); } - fcntl(this->fdpair[0], F_SETFL, O_NONBLOCK); + int ok = fcntl(this->fdpair[0], F_SETFL, O_NONBLOCK); + if (ok == -1) return false; this->strace = fdopen(this->fdpair[0], "r"); this->fd_strace = fileno(this->strace); return true; |