From: Jens Axboe Date: Sun, 30 Apr 2017 22:48:24 +0000 (-0600) Subject: Merge branch 'fix-348' of https://github.com/omor1/fio X-Git-Tag: fio-2.20~26 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c08d28cbba96a63928f3dc05bb57d3cde9529ef6;hp=7922a7b75ea9f5cdc7505bb98bbed100d3e3d124 Merge branch 'fix-348' of https://github.com/omor1/fio --- diff --git a/os/os-android.h b/os/os-android.h index 1d11cccd..ba599ddd 100644 --- a/os/os-android.h +++ b/os/os-android.h @@ -88,14 +88,14 @@ static inline int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) static inline int shmget (key_t __key, size_t __size, int __shmflg) { int fd,ret; - char key[11]; - + char keybuf[11]; + fd = open(ASHMEM_DEVICE, O_RDWR); if (fd < 0) return fd; - sprintf(key,"%d",__key); - ret = ioctl(fd, ASHMEM_SET_NAME, key); + sprintf(keybuf,"%d",__key); + ret = ioctl(fd, ASHMEM_SET_NAME, keybuf); if (ret < 0) goto error; @@ -104,7 +104,7 @@ static inline int shmget (key_t __key, size_t __size, int __shmflg) goto error; return fd; - + error: close(fd); return ret;