pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 zones



The following reply was made to PR pkg/45289; it has been noted by GNATS.

From: Zdenek Tlusty <tlusty%vse.cz@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 zones
Date: Mon, 9 Jan 2012 22:44:39 +0100

 Toto je zpr va s v¡ce ? stmi ve form tu MIME. 
 --=_alternative 00776EAAC1257980_=
 Content-Type: text/plain; charset="US-ASCII"
 
 Hello,
 
 will be my patch accepted or will be the bug resolved by any other way?
 
 BR,
 
 Zdenek
 
 Zdenek Tlusty <tlusty%vse.cz@localhost> napsal dne 26.08.2011 10:30:04:
 
 > Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 
 zones
 > Date: Fri, 26 Aug 2011 10:26:16 +0200
 > 
 >  Thanks for the hint. Below is updated diff.
 > 
 >  BR,
 > 
 >  Zdenek
 > 
 > 
 >  --- perform.c?rev=1.99  2010-12-12 14:18:38.000000000 +0100
 >  +++ perform.c   2011-08-26 10:23:51.000000000 +0200
 >  @@ -59,7 +59,9 @@
 >   #include "lib.h"
 >   #include "add.h"
 >   #include "version.h"
 >  +#include <dirent.h>
 > 
 >  +DIR *dir_pointer;
 >   struct pkg_meta {
 >          char *meta_contents;
 >          char *meta_comment;
 >  @@ -175,11 +177,16 @@
 >           * Handle the easy case of direct success or
 >           * pre-existing directory first.
 >           */
 >  -       if (mkdir(path, 0777) == 0 || errno == EEXIST)
 >  -               return 0;
 >  -       if (errno != ENOENT)
 >  -               return -1;
 >  -
 >  +       dir_pointer = opendir (path);
 >  +       if (dir_pointer == NULL) {
 >  +           if (mkdir(path, 0777) == 0 || errno == EEXIST)
 >  +                   return 0;
 >  +           if (errno != ENOENT)
 >  +                   return -1;
 >  +       }
 >  +       else {
 >  +           (void) closedir (dir_pointer);
 >  +       }
 >          cur_end = p = xstrdup(path);
 > 
 >          for (;;) {
 >  @@ -202,9 +209,15 @@
 >                   * ENOENT can only happen if something else races us,
 >                   * in which case we should better give up.
 >                   */
 >  -               if (mkdir(p, 0777) == -1 && errno != EEXIST) {
 >  -                       free(p);
 >  -                       return -1;
 >  +               dir_pointer = opendir (p);
 >  +               if (dir_pointer == NULL) {
 >  +                   if (mkdir(p, 0777) == -1 && errno != EEXIST) {
 >  +                           free(p);
 >  +                           return -1;
 >  +                   }
 >  +               }
 >  +               else {
 >  +                   (void) closedir (dir_pointer);
 >                  }
 >                  if (done)
 >                          break;
 
 --=_alternative 00776EAAC1257980_=
 Content-Type: text/html; charset="US-ASCII"
 
 <font size=2 face="sans-serif">Hello,</font>
 <br>
 <br><font size=2 face="sans-serif">will be my patch accepted or will be
 the bug resolved by any other way?</font>
 <br>
 <br><font size=2 face="sans-serif">BR,</font>
 <br>
 <br><font size=2 face="sans-serif">Zdenek</font>
 <br>
 <br><tt><font size=2>Zdenek Tlusty &lt;tlusty%vse.cz@localhost&gt; napsal dne 
26.08.2011
 10:30:04:<br>
 <br>
 &gt; Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris
 10 zones<br>
 &gt; Date: Fri, 26 Aug 2011 10:26:16 +0200<br>
 &gt; <br>
 &gt; &nbsp;Thanks for the hint. Below is updated diff.<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;BR,<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;Zdenek<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;--- perform.c?rev=1.99 &nbsp;2010-12-12 14:18:38.000000000 +0100<br>
 &gt; &nbsp;+++ perform.c &nbsp; 2011-08-26 10:23:51.000000000 +0200<br>
 &gt; &nbsp;@@ -59,7 +59,9 @@<br>
 &gt; &nbsp; #include &quot;lib.h&quot;<br>
 &gt; &nbsp; #include &quot;add.h&quot;<br>
 &gt; &nbsp; #include &quot;version.h&quot;<br>
 &gt; &nbsp;+#include &lt;dirent.h&gt;<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;+DIR *dir_pointer;<br>
 &gt; &nbsp; struct pkg_meta {<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;char *meta_contents;<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;char *meta_comment;<br>
 &gt; &nbsp;@@ -175,11 +177,16 @@<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * Handle the easy case of direct
 success or<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * pre-existing directory first.<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; if (mkdir(path, 0777) == 0 || errno ==
 EEXIST)<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0;<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; if (errno != ENOENT)<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -1;<br>
 &gt; &nbsp;-<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; dir_pointer = opendir (path);<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; if (dir_pointer == NULL) {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (mkdir(path, 0777) ==
 0 || errno == EEXIST)<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 return 0;<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (errno != ENOENT)<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 return -1;<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; }<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; else {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (void) closedir 
(dir_pointer);<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; }<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cur_end = p = xstrdup(path);<br>
 &gt; &nbsp;<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for (;;) {<br>
 &gt; &nbsp;@@ -202,9 +209,15 @@<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * ENOENT
 can only happen if something else races us,<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * in
 which case we should better give up.<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (mkdir(p,
 0777) == -1 &amp;&amp; errno != EEXIST) {<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; free(p);<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; return -1;<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dir_pointer
 = opendir (p);<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (dir_pointer
 == NULL) {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 if (mkdir(p, 0777) == -1 &amp;&amp; errno != EEXIST) {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; free(p);<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; return -1;<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 }<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 (void) closedir (dir_pointer);<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if 
(done)<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp;break;<br>
 </font></tt>
 --=_alternative 00776EAAC1257980_=--
 


Home | Main Index | Thread Index | Old Index