Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: fusl/src/process/posix_spawn_file_actions_addopen.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #include <spawn.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <errno.h>
5 #include "fdop.h"
6
7 int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *restrict fa, in t fd, const char *restrict path, int flags, mode_t mode)
8 {
9 struct fdop *op = malloc(sizeof *op + strlen(path) + 1);
10 if (!op) return ENOMEM;
11 op->cmd = FDOP_OPEN;
12 op->fd = fd;
13 op->oflag = flags;
14 op->mode = mode;
15 strcpy(op->path, path);
16 if ((op->next = fa->__actions)) op->next->prev = op;
17 op->prev = 0;
18 fa->__actions = op;
19 return 0;
20 }
OLDNEW
« no previous file with comments | « fusl/src/process/posix_spawn_file_actions_adddup2.c ('k') | fusl/src/process/posix_spawn_file_actions_destroy.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698