summaryrefslogtreecommitdiff
path: root/libgps_shm.c
diff options
context:
space:
mode:
authorZbigniew Chyla <zbigniew.chyla@nokia.com>2015-05-02 02:02:49 +0200
committerEric S. Raymond <esr@thyrsus.com>2015-06-01 05:18:54 -0400
commit4827ed805c6a03b8a4592a366bd13d94cc6a2689 (patch)
tree7dbe22f1cc68b1524959679d0920cf985a7c3c22 /libgps_shm.c
parente69347122900ad16924e67df437d8c49ae360483 (diff)
downloadgpsd-4827ed805c6a03b8a4592a366bd13d94cc6a2689.tar.gz
Fix checking the result of shmat() call
The code was checking "privdata" pointer instead of shmat() result.
Diffstat (limited to 'libgps_shm.c')
-rw-r--r--libgps_shm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgps_shm.c b/libgps_shm.c
index 34de8efa..18ac14af 100644
--- a/libgps_shm.c
+++ b/libgps_shm.c
@@ -57,7 +57,7 @@ int gps_shm_open(struct gps_data_t *gpsdata)
return -1;
PRIVATE(gpsdata)->shmseg = shmat(shmid, 0, 0);
- if ((int)(long)gpsdata->privdata == -1) {
+ if (PRIVATE(gpsdata)->shmseg == (void *) -1) {
/* attach failed for sume unknown reason */
return -2;
}