[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: duplicate delivery with Solaris



On Wed, 10 Dec 1997 mea@nic.funet.fi wrote:
 
> Date: Wed, 10 Dec 1997 19:23:25 +0200 (GMT)
> From: mea@nic.funet.fi
> To: peter.ip@utoronto.ca
> Cc: zmailer@nic.funet.fi
> Subject: Re: duplicate delivery with Solaris
>
> ....
>
> int
> erename(from, to)
>       char *from, *to;
> {
>
> #ifdef        HAVE_RENAME
>
>       while (rename(from, to) < 0) {
>         if (errno == EBUSY || errno == EINTR) {
/* add this to delete "to" */
                while (unlink(to) < 0) {
                  if (errno == ENOENT) break; /* Ok! */
                  if (errno == EBUSY || errno == EINTR)
                        continue; /* Sigh, solaris... */
                  fprintf(stderr, "%s: rename(%s,%s): %s\n", progname,
                          from, to, strerror(errno));
                  return -1;
                }
                continue; /* Sigh, solaris BUSY.. */
          }
>         fprintf(stderr, "%s: rename(%s,%s): %s\n", progname,
>                 from, to, strerror(errno));
>         return -1;
>       }
>
> #else /* !HAVE_RENAME */
>       ....
>       }
> #endif        /* !HAVE_RENAME */
>
>       return 0;
> }
>
>
>       (and likewise for  eqrename() )
>
 
Thanks for the response. I've run it using a test program and I found that
the rename part needs to unlink(to) if EBUSY. Otherwise, it seems to work.
We've talked to Sun and they say that there might be a fix in Solaris 2.7
(not even 2.6!). Sigh!
 
_____________________________________________________
Peter Ip, PhD
Computing and Network Services, University of Toronto
email: peter.ip@utoronto.ca