svn commit: r201660 - user/ed/utmpx/lib/libc/gen

Ed Schouten ed at FreeBSD.org
Wed Jan 6 19:29:19 UTC 2010


Author: ed
Date: Wed Jan  6 19:29:18 2010
New Revision: 201660
URL: http://svn.freebsd.org/changeset/base/201660

Log:
  Remove silly bugs from getutxent() and pututxline().
  
  - Unbreak getutxent() on UTXDB_LOG (wtmp) files by not always returning
    NULL instead of the proper entry.
  - Unbreak UTXDB_LOG writing of pututxline() of DEAD_PROCESS by properly
    breaking from the switch statement.

Modified:
  user/ed/utmpx/lib/libc/gen/getutxent.c
  user/ed/utmpx/lib/libc/gen/pututxline.c

Modified: user/ed/utmpx/lib/libc/gen/getutxent.c
==============================================================================
--- user/ed/utmpx/lib/libc/gen/getutxent.c	Wed Jan  6 18:21:22 2010	(r201659)
+++ user/ed/utmpx/lib/libc/gen/getutxent.c	Wed Jan  6 19:29:18 2010	(r201660)
@@ -157,7 +157,6 @@ getfutxent(void)
 			if (fread(&fu, len, 1, uf) != 1)
 				return (NULL);
 		}
-		return (NULL);
 	} else {
 		if (fread(&fu, sizeof fu, 1, uf) != 1)
 			return (NULL);

Modified: user/ed/utmpx/lib/libc/gen/pututxline.c
==============================================================================
--- user/ed/utmpx/lib/libc/gen/pututxline.c	Wed Jan  6 18:21:22 2010	(r201659)
+++ user/ed/utmpx/lib/libc/gen/pututxline.c	Wed Jan  6 19:29:18 2010	(r201660)
@@ -254,10 +254,12 @@ pututxline(const struct utmpx *utmpx)
 	case DEAD_PROCESS:
 		if (utx_active_remove(&fu) != 0)
 			return (NULL);
+		break;
 	default:
 		return (NULL);
 	}
 
 	utx_log_add(&fu);
+	/* XXX: return an entry on success! */
 	return (NULL);
 }


More information about the svn-src-user mailing list