X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fprocess%2Fposix_spawn_file_actions_addopen.c;h=82bbcec9eb42cd5f112d2a6b66d0769b8349f11f;hb=122002f0ddf267977282f05066a0794e31661501;hp=af3ca604fe0ee8125d9677e9028ae0e58f4d0b40;hpb=f48832ee15027763826c8a7ff9eeed3fc06bb499;p=musl diff --git a/src/process/posix_spawn_file_actions_addopen.c b/src/process/posix_spawn_file_actions_addopen.c index af3ca604..82bbcec9 100644 --- a/src/process/posix_spawn_file_actions_addopen.c +++ b/src/process/posix_spawn_file_actions_addopen.c @@ -4,8 +4,9 @@ #include #include "fdop.h" -int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *fa, int fd, const char *path, int flags, mode_t mode) +int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *restrict fa, int fd, const char *restrict path, int flags, mode_t mode) { + if (fd < 0) return EBADF; struct fdop *op = malloc(sizeof *op + strlen(path) + 1); if (!op) return ENOMEM; op->cmd = FDOP_OPEN;