about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-07-06 00:03:07 +0000
committerMiles Bader <miles@gnu.org>1996-07-06 00:03:07 +0000
commit36abf0d831de627092222bda744ef9887ada1cb3 (patch)
tree987ad3f1bffd23b61727bfa897fedd747c55461a
parent61c7fd70ca07fbb323480424cba73d5a18833722 (diff)
downloadglibc-36abf0d831de627092222bda744ef9887ada1cb3.tar.gz
glibc-36abf0d831de627092222bda744ef9887ada1cb3.tar.xz
glibc-36abf0d831de627092222bda744ef9887ada1cb3.zip
(pututline_r): Since we assign RESULT from lseek now, check that it's >= 0, not == 0.
-rw-r--r--login/pututline_r.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/login/pututline_r.c b/login/pututline_r.c
index 382716ce80..4c9a91fdec 100644
--- a/login/pututline_r.c
+++ b/login/pututline_r.c
@@ -96,13 +96,13 @@ pututline_r (const struct utmp *id, struct utmp_data *utmp_data)
   /* Find out how large the file is.  */
   result = fstat (utmp_data->ut_fd, &st);
 
-  if (result == 0)
+  if (result >= 0)
     /* Position file correctly.  */
     if (utmp_data->loc_utmp < sizeof (struct utmp))
       /* Not located at any valid entry.  Add at the end.  */
       {
 	result = lseek (utmp_data->ut_fd, 0L, SEEK_END);
-	if (result == 0)
+	if (result >= 0)
 	  /* Where we'll be if the write succeeds.  */
 	  utmp_data->loc_utmp = st.st_size + sizeof (struct utmp);
       }
@@ -111,7 +111,7 @@ pututline_r (const struct utmp *id, struct utmp_data *utmp_data)
 	lseek (utmp_data->ut_fd, utmp_data->loc_utmp - sizeof (struct utmp),
 	       SEEK_SET);
 
-  if (result == 0)
+  if (result >= 0)
     /* Write the new data.  */
     if (write (utmp_data->ut_fd, id, sizeof (struct utmp))
 	!= sizeof (struct utmp))