version 1.41, 2017/01/20 10:26:16 |
version 1.42, 2017/08/01 18:05:53 |
|
|
if (*p == '\0') |
if (*p == '\0') |
error(COMPILE, "filename expected"); |
error(COMPILE, "filename expected"); |
cmd->t = duptoeol(p, "w command", NULL); |
cmd->t = duptoeol(p, "w command", NULL); |
if (aflag) |
if (aflag) { |
cmd->u.fd = -1; |
cmd->u.fd = -1; |
|
pledge_wpath = 1; |
|
} |
else if ((cmd->u.fd = open(p, |
else if ((cmd->u.fd = open(p, |
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC, |
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC, |
DEFFILEMODE)) == -1) |
DEFFILEMODE)) == -1) |
error(FATAL, "%s: %s", p, strerror(errno)); |
error(FATAL, "%s: %s", p, strerror(errno)); |
break; |
break; |
case RFILE: /* r */ |
case RFILE: /* r */ |
|
pledge_rpath = 1; |
p++; |
p++; |
EATSPACE(); |
EATSPACE(); |
cmd->t = duptoeol(p, "read command", NULL); |
cmd->t = duptoeol(p, "read command", NULL); |
|
|
if (q == wfile) |
if (q == wfile) |
error(COMPILE, "no wfile specified"); |
error(COMPILE, "no wfile specified"); |
s->wfile = strdup(wfile); |
s->wfile = strdup(wfile); |
if (!aflag && (s->wfd = open(wfile, |
if (aflag) |
|
pledge_wpath = 1; |
|
else if ((s->wfd = open(wfile, |
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC, |
O_WRONLY|O_APPEND|O_CREAT|O_TRUNC, |
DEFFILEMODE)) == -1) |
DEFFILEMODE)) == -1) |
error(FATAL, "%s: %s", wfile, strerror(errno)); |
error(FATAL, "%s: %s", wfile, strerror(errno)); |