gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH] Initialize msocks[2] to -1


From: Yufeng Shen
Subject: [gpsd-dev] [PATCH] Initialize msocks[2] to -1
Date: Tue, 15 Nov 2011 17:35:47 -0500

>From 82ec90bb92e6f842e39c7127fff49bcabdeeed17 Mon Sep 17 00:00:00 2001
From: Yufeng Shen <address@hidden>
Date: Tue, 15 Nov 2011 17:29:49 -0500
Subject: [PATCH] Initialize msocks[2] to -1

When SOCKET_EXPORT_ENABLE is not defined, msocks[2] can reach the
point where it is used (put into all_fds to be monitored by select()),
without initilization.

Signed-off-by: Yufeng Shen <address@hidden>
---
 gpsd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gpsd.c b/gpsd.c
index 2d4090f..d342f5a 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1762,7 +1762,8 @@ int main(int argc, char *argv[])
     static char *pid_file = NULL;
     struct gps_device_t *device;
     fd_set rfds;
-    int i, option, msocks[2], dfd;
+    int i, option, dfd;
+    int msocks[2] = {-1, -1};
     bool go_background = true;
     struct timeval tv;
     const struct gps_type_t **dp;
-- 
1.7.3.1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]