-- return -1;
-- }
-+ if (fdx >= 0 || wtmpx_file != NULL)
-+ {
-+#if defined(__sparcv9) && !defined(__NetBSD__)
-+ struct futmpx utx;
-+#else
-+ struct utmpx utx;
-+ time_t t;
-+#endif
-
-- /* Unfortunately, utmp string fields are terminated by '\0' if they are
-- * shorter than the size of the field, but if they are exactly the size of
-- * the field they don't have to be terminated at all. Frankly, this sucks.
-- * Insane if you ask me. Unless there's massive uproar, I prefer to err on
-- * the side of caution and always null-terminate our strings.
-- */
-- if (fstat(fdx, &buf) == 0) {
-- memset(&utx, 0, sizeof(utx));
-+ if (fdx < 0 && (fdx = open(wtmpx_file, O_WRONLY|O_APPEND, 0)) < 0) {