static time_t
get_boot_time ()
{
+#ifdef BOOT_TIME
struct utmp ut, *utp;
if (boot_time)
if (!utp)
return boot_time = 1;
return boot_time = utp->ut_time;
+#else
+ return 0;
+#endif;
}
\f
/* Here is the structure that stores information about a lock. */
int force;
{
register int err;
+ time_t boot_time;
char *user_name;
char *host_name;
char *lock_info_str;
lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name)
+ LOCK_PID_MAX + 5);
- sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name,
- (unsigned long) getpid (), (unsigned long) get_boot_time ());
+ boot_time = get_boot_time ();
+ if (boot_time)
+ sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name,
+ (unsigned long) getpid (), (unsigned long) boot_time);
+ else
+ sprintf (lock_info_str, "%s@%s.%lu", user_name, host_name,
+ (unsigned long) getpid ());
err = symlink (lock_info_str, lfname);
if (errno == EEXIST && force)