This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 6/6] support: Add support_create_temp_fifo


* Adhemerval Zanella:

> +int
> +support_create_temp_fifo (const char *base, char **fifoname)
> +{
> +  char *fname = xasprintf ("%s/%sXXXXXX", test_dir, base);
> +  mktemp (fname);
> +
> +  int fd = mkfifo (fname, 0600);
> +  if (fd == -1)
> +    {
> +      printf ("cannot open temporary fifo '%s': %m\n", fname);
> +      free (fname);
> +      return -1;
> +    }

Ideally, this needs an error check for mktemp and a retry loop,
similar to what mkstemp does internally.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]