diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-12-18 22:21:23 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-12-18 22:21:23 +0000 |
commit | 956ff38121ca10af2fc33dd1700f29bb80bf716c (patch) | |
tree | e352f9643d2c254d019fd71a203b66486e4584a4 /sys/src/cmd/cifs | |
parent | e7a266a6354eda00d81ef3a7cad0153e4a3ff510 (diff) |
cifs: use procsetname() instead of rolling your own
Diffstat (limited to 'sys/src/cmd/cifs')
-rw-r--r-- | sys/src/cmd/cifs/main.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/src/cmd/cifs/main.c b/sys/src/cmd/cifs/main.c index 9f9f7a6f0..db1f599ec 100644 --- a/sys/src/cmd/cifs/main.c +++ b/sys/src/cmd/cifs/main.c @@ -50,9 +50,6 @@ static char *Ipcname = "IPC$"; void setup(void) { - int fd; - char buf[32]; - /* * This is revolting but I cannot see any other way to get * the pid of the server. We need this as Windows doesn't @@ -61,11 +58,7 @@ setup(void) */ Attachpid = getpid(); - snprint(buf, sizeof buf, "#p/%d/args", getpid()); - if((fd = open(buf, OWRITE)) >= 0){ - fprint(fd, "%s network", Host); - close(fd); - } + procsetname("%s network", Host); } int @@ -1135,15 +1128,10 @@ usage(void) static void keepalive(void) { - char buf[32]; uvlong tot, fre; - int fd, i, slot, rc; + int i, slot, rc; - snprint(buf, sizeof buf, "#p/%d/args", getpid()); - if((fd = open(buf, OWRITE)) >= 0){ - fprint(fd, "%s keepalive", Host); - close(fd); - } + procsetname("%s keepalive", Host); rc = 0; slot = 0; |