diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-01 18:22:39 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-01 18:22:39 +0000 |
commit | ea96823f2626e2a4178eec54f8a78a666d376ac1 (patch) | |
tree | d6fd63606de3355d2e0f7bb2ab751116095a1451 /utils/muted.c | |
parent | 1c4fdfd503883d806ba05da5d0e9156b54a4d51b (diff) |
fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings being passed to printf()-like functions and ignored results from read()/write() and friends
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153337 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils/muted.c')
-rw-r--r-- | utils/muted.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/muted.c b/utils/muted.c index c406258e1..179d596a6 100644 --- a/utils/muted.c +++ b/utils/muted.c @@ -114,7 +114,9 @@ static int load_config(void) return -1; } while(!feof(f)) { - fgets(buf, sizeof(buf), f); + if (!fgets(buf, sizeof(buf), f)) { + continue; + } if (!feof(f)) { lineno++; val = strchr(buf, '#'); @@ -682,7 +684,10 @@ int main(int argc, char *argv[]) } if (needfork) { #ifndef HAVE_SBIN_LAUNCHD - daemon(0,0); + if (daemon(0,0) < 0) { + fprintf(stderr, "daemon() failed: %s\n", strerror(errno)); + exit(1); + } #else fprintf(stderr, "Mac OS X detected. Use 'launchd -d muted -f' to launch.\n"); exit(1); |