mirror of https://gerrit.osmocom.org/libosmocore
compiler warnings: take care of compiler warning "unused-result"
Though it makes no sense to handle the return code of freopen() here, the compiler complains about it. The #pragma statements take care of that. Change-Id: Ia2caadbed2a24f84d1d55a47236b398b74224e82
This commit is contained in:
parent
15596e2a7f
commit
18a62b0488
|
@ -156,9 +156,16 @@ int osmo_daemonize(void)
|
|||
/* Redirect stdio to /dev/null */
|
||||
/* since C89/C99 says stderr is a macro, we can safely do this! */
|
||||
#ifdef stderr
|
||||
/*
|
||||
* it does not make sense to check the return code here, so we just
|
||||
* ignore the compiler warning from gcc
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-result"
|
||||
freopen("/dev/null", "r", stdin);
|
||||
freopen("/dev/null", "w", stdout);
|
||||
freopen("/dev/null", "w", stderr);
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue