+ /* Try to get boot time from the current wtmp file. */
+ get_boot_time_1 (WTMP_FILE, 1);
+
+ /* If we did not find a boot time in wtmp, look at wtmp, and so on. */
+ for (counter = 0; counter < 20 && ! boot_time; counter++)
+ {
+ char cmd_string[100];
+ Lisp_Object tempname, filename;
+ int delete_flag = 0;
+
+ filename = Qnil;
+
+ sprintf (cmd_string, "%s.%d", WTMP_FILE, counter);
+ tempname = build_string (cmd_string);
+ if (! NILP (Ffile_exists_p (tempname)))
+ filename = tempname;
+ else
+ {
+ sprintf (cmd_string, "%s.%d.gz", WTMP_FILE, counter);
+ tempname = build_string (cmd_string);
+ if (! NILP (Ffile_exists_p (tempname)))
+ {
+ Lisp_Object args[6];
+
+ /* The utmp functions on mescaline.gnu.org accept only
+ file names up to 8 characters long. Choose a 2
+ character long prefix, and call make_temp_file with
+ second arg non-zero, so that it will add not more
+ than 6 characters to the prefix. */
+ tempname = Fexpand_file_name (build_string ("wt"),
+ Vtemporary_file_directory);
+ tempname = make_temp_name (tempname, 1);
+ args[0] = Vshell_file_name;
+ args[1] = Qnil;
+ args[2] = Qnil;
+ args[3] = Qnil;
+ args[4] = build_string ("-c");
+ sprintf (cmd_string, "gunzip < %s.%d.gz > %s",
+ WTMP_FILE, counter, SDATA (tempname));
+ args[5] = build_string (cmd_string);
+ Fcall_process (6, args);
+ filename = tempname;
+ delete_flag = 1;
+ }
+ }