mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 00:58:12 +00:00
shm: Don't use PATH_MAX
PATH_MAX is not defined on GNU Hurd and others. Also fix format string.
This commit is contained in:
parent
e5fc7a9f13
commit
01b7b10d0b
1 changed files with 2 additions and 2 deletions
|
@ -262,7 +262,7 @@ static ShmArea *
|
||||||
sp_open_shm (char *path, int id, mode_t perms, size_t size)
|
sp_open_shm (char *path, int id, mode_t perms, size_t size)
|
||||||
{
|
{
|
||||||
ShmArea *area = spalloc_new (ShmArea);
|
ShmArea *area = spalloc_new (ShmArea);
|
||||||
char tmppath[PATH_MAX];
|
char tmppath[32];
|
||||||
int flags;
|
int flags;
|
||||||
int prot;
|
int prot;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -285,7 +285,7 @@ sp_open_shm (char *path, int id, mode_t perms, size_t size)
|
||||||
area->shm_fd = shm_open (path, flags, perms);
|
area->shm_fd = shm_open (path, flags, perms);
|
||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
snprintf (tmppath, PATH_MAX, "/shmpipe.5%d.%5d", getpid (), i++);
|
snprintf (tmppath, sizeof (tmppath), "/shmpipe.%5d.%5d", getpid (), i++);
|
||||||
area->shm_fd = shm_open (tmppath, flags, perms);
|
area->shm_fd = shm_open (tmppath, flags, perms);
|
||||||
} while (area->shm_fd < 0 && errno == EEXIST);
|
} while (area->shm_fd < 0 && errno == EEXIST);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue