error (0, errno, _("failure while writing data for category `%s'"), category);
if (!be_quiet) error (0, errno, _("failure while writing data for category `%s'"), category);
write_locale_data (const char *output_path, const char *category,		   size_t n_elem, struct iovec *vec){  size_t cnt, step, maxiov;  int fd;  char *fname;  fname = malloc (strlen (output_path) + 2 * strlen (category) + 6);  if (fname == NULL)    error (5, errno, _("memory exhausted"));  /* Normally we write to the directory pointed to by the OUTPUT_PATH.     But for LC_MESSAGES we have to take care for the translation     data.  This means we need to have a directory LC_MESSAGES in     which we place the file under the name SYS_LC_MESSAGES.  */  sprintf (fname, "%s%s", output_path, category);  if (strcmp (category, "LC_MESSAGES") == 0)    {      struct stat st;      if (stat (fname, &st) < 0)	{	  if (mkdir (fname, 0777) < 0)	    fd = creat (fname, 0666);	  else	    {	      fd = -1;	      errno = EISDIR;	    }	}      else if (S_ISREG (st.st_mode))	fd = creat (fname, 0666);      else	{	  fd = -1;	  errno = EISDIR;	}    }  else    fd = creat (fname, 0666);  if (fd == -1)    {      int save_err = errno;      if (errno == EISDIR)	{	  sprintf (fname, "%1$s%2$s/SYS_%2$s", output_path, category);	  fd = creat (fname, 0666);	  if (fd == -1)	    save_err = errno;	}      if (fd == -1 && !be_quiet)	{	  error (0, save_err, _("\cannot open output file `%s' for category `%s'"),		 fname, category);	  return;	}    }  free (fname);#ifdef UIO_MAXIOV  maxiov = UIO_MAXIOV;#else  maxiov = sysconf (_SC_UIO_MAXIOV);#endif  /* Write the data using writev.  But we must take care for the     limitation of the implementation.  */  for (cnt = 0; cnt < n_elem; cnt += step)    {      step = n_elem - cnt;      if (maxiov > 0)	step = MIN (maxiov, step);      if (writev (fd, &vec[cnt], step) < 0 && !be_quiet)	{	  error (0, errno, _("failure while writing data for category `%s'"),		 category);	  break;	}    }  close (fd);}