From 956ff38121ca10af2fc33dd1700f29bb80bf716c Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 18 Dec 2022 22:21:23 +0000 Subject: cifs: use procsetname() instead of rolling your own --- sys/src/cmd/cifs/main.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'sys/src') 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; -- cgit v1.2.3