svn commit: r368777 - head/usr.bin/login

Pedro F. Giffuni pfg at FreeBSD.org
Sat Dec 19 02:42:15 UTC 2020


Author: pfg
Date: Sat Dec 19 02:42:14 2020
New Revision: 368777
URL: https://svnweb.freebsd.org/changeset/base/368777

Log:
  Revert r368776:
  login(1): when exporting variables check the result of setenv(3)
  
  mismatch: the return value upon error is -1, so the code was not
  doing nothing.

Modified:
  head/usr.bin/login/login.c

Modified: head/usr.bin/login/login.c
==============================================================================
--- head/usr.bin/login/login.c	Sat Dec 19 02:23:53 2020	(r368776)
+++ head/usr.bin/login/login.c	Sat Dec 19 02:42:14 2020	(r368777)
@@ -793,7 +793,6 @@ export(const char *s)
 	char *p;
 	const char **pp;
 	size_t n;
-	int rv;
 
 	if (strlen(s) > 1024 || (p = strchr(s, '=')) == NULL)
 		return (0);
@@ -805,10 +804,8 @@ export(const char *s)
 			return (0);
 	}
 	*p = '\0';
-	rv = setenv(s, p + 1, 1);
+	(void)setenv(s, p + 1, 1);
 	*p = '=';
-	if (rv == 1)
-		return (0);
 	return (1);
 }
 


More information about the svn-src-all mailing list