summaryrefslogtreecommitdiff
path: root/shmexport.c
diff options
context:
space:
mode:
authorZbigniew Chyla <zbigniew.chyla@nokia.com>2015-04-24 17:55:00 +0200
committerEric S. Raymond <esr@thyrsus.com>2015-04-28 08:29:07 -0400
commit4f5c06746aef13298b5609558001beda0326da39 (patch)
tree9b5fc625debe811140309dd7ab0343f09c48c432 /shmexport.c
parentd1965788249d7e22cdde4021d452cf0dc6c6b9bd (diff)
downloadgpsd-4f5c06746aef13298b5609558001beda0326da39.tar.gz
Replace overly complex memcpy with struct assignment
Diffstat (limited to 'shmexport.c')
-rw-r--r--shmexport.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/shmexport.c b/shmexport.c
index 6e7dc274..bd118c9a 100644
--- a/shmexport.c
+++ b/shmexport.c
@@ -90,9 +90,7 @@ void shm_update(struct gps_context_t *context, struct gps_data_t *gpsdata)
*/
shared->bookend2 = tick;
memory_barrier();
- memcpy((void *)((char *)context->shmexport + offsetof(struct shmexport_t, gpsdata)),
- (void *)gpsdata,
- sizeof(struct gps_data_t));
+ shared->gpsdata = *gpsdata;
memory_barrier();
#ifndef USE_QT
shared->gpsdata.gps_fd = SHM_PSEUDO_FD;