chiark
/
gitweb
/
~bjharris
/
clunk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed113db
)
Fix init_statefile to not use optarg.
author
Ben Harris
<bjh21@bjh21.me.uk>
Thu, 22 Nov 2018 22:34:33 +0000
(22:34 +0000)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Sat, 8 Dec 2018 22:30:09 +0000
(22:30 +0000)
I failed to update it to use a local variable when I moved it out of
init().
clunk.c
patch
|
blob
|
history
diff --git
a/clunk.c
b/clunk.c
index 312371f14fd4184c211068bf6c001c9bab66dae6..0f0df9e5d6d0b14a61e7c43affee725b0dfcefb8 100644
(file)
--- a/
clunk.c
+++ b/
clunk.c
@@
-112,12
+112,12
@@
init_statefile(char const *statefilename)
char buf[10];
ssize_t len;
- statefd = open(
optarg
, O_RDWR | O_CREAT | O_DSYNC, 0666);
+ statefd = open(
statefilename
, O_RDWR | O_CREAT | O_DSYNC, 0666);
if (statefd == -1)
- err(1, "%s",
optarg
);
+ err(1, "%s",
statefilename
);
len = pread(statefd, buf, 9, 0);
if (len == -1)
- err(1, "read %s",
optarg
);
+ err(1, "read %s",
statefilename
);
if (len > 0) {
buf[len] = '\0';
init_statestring(buf);