close (fd);
__close (fd);
updwtmp_file (const char *file, const struct utmp *utmp){  int result = -1;  off_t offset;  int fd;  /* Open WTMP file.  */  fd = open (file, O_WRONLY);  if (fd < 0)    return -1;  LOCK_FILE (fd, F_WRLCK);  /* Remember original size of log file.  */  offset = lseek (fd, 0, SEEK_END);  if (offset % sizeof (struct utmp) != 0)    {      offset -= offset % sizeof (struct utmp);      __ftruncate (fd, offset);      if (lseek (fd, 0, SEEK_END) < 0)	goto unlock_return;    }  /* Write the entry.  If we can't write all the bytes, reset the file     size back to the original size.  That way, no partial entries     will remain.  */  if (write (fd, utmp, sizeof (struct utmp)) != sizeof (struct utmp))    {      __ftruncate (fd, offset);      goto unlock_return;    }  result = 0;unlock_return:  UNLOCK_FILE (fd);  /* Close WTMP file.  */  close (fd);  return result;}