--- pinky.c.old	2008-07-04 10:04:54.000000000 +0530
+++ pinky.c	2008-07-04 12:56:35.127925656 +0530
@@ -331,7 +331,7 @@
   if (pw == NULL)
     {
       printf (" %s", _("???\n"));
-      return;
+      error (EXIT_FAILURE, 0, "no user found", program_name);
     }
   else
     {
@@ -438,6 +438,7 @@
 scan_entries (size_t n, const STRUCT_UTMP *utmp_buf,
 	      const int argc_names, char *const argv_names[])
 {
+  int not_found_flg = true;
   if (hard_locale (LC_TIME))
     {
       time_format = "%Y-%m-%d %H:%M";
@@ -464,15 +465,21 @@
 		if (strncmp (UT_USER (utmp_buf), argv_names[i], UT_USER_SIZE)
 		    == 0)
 		  {
+               not_found_flg = false;
 		    print_entry (utmp_buf);
 		    break;
 		  }
 	    }
-	  else
-	    print_entry (utmp_buf);
+	  else 
+         {
+	      not_found_flg = false;
+	      print_entry (utmp_buf);
+	    }
 	}
       utmp_buf++;
     }
+  if (not_found_flg) 
+    error (EXIT_FAILURE, 0, "user not found", program_name);
 }
 
 /* Display a list of who is on the system, according to utmp file FILENAME. */
