Explorar el Código

username(): get rid of unneeded uid variable

Aaron Marcher hace 8 años
padre
commit
b2714032e5
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      slstatus.c

+ 1 - 2
slstatus.c

@@ -643,8 +643,7 @@ uptime(void)
 static char *
 username(void)
 {
-	uid_t uid = geteuid();
-	struct passwd *pw = getpwuid(uid);
+	struct passwd *pw = getpwuid(geteuid());
 
 	if (pw == NULL) {
 		warn("Failed to get username");