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 <tlusty%vse.cz@localhost> napsal dne
26.08.2011
10:30:04:<br>
<br>
> Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris
10 zones<br>
> Date: Fri, 26 Aug 2011 10:26:16 +0200<br>
> <br>
> Thanks for the hint. Below is updated diff.<br>
> <br>
> BR,<br>
> <br>
> Zdenek<br>
> <br>
> <br>
> --- perform.c?rev=1.99 2010-12-12 14:18:38.000000000 +0100<br>
> +++ perform.c 2011-08-26 10:23:51.000000000 +0200<br>
> @@ -59,7 +59,9 @@<br>
> #include "lib.h"<br>
> #include "add.h"<br>
> #include "version.h"<br>
> +#include <dirent.h><br>
> <br>
> +DIR *dir_pointer;<br>
> struct pkg_meta {<br>
> char *meta_contents;<br>
> char *meta_comment;<br>
> @@ -175,11 +177,16 @@<br>
> * Handle the easy case of direct
success or<br>
> * pre-existing directory first.<br>
> */<br>
> - if (mkdir(path, 0777) == 0 || errno ==
EEXIST)<br>
> - return 0;<br>
> - if (errno != ENOENT)<br>
> - return -1;<br>
> -<br>
> + dir_pointer = opendir (path);<br>
> + if (dir_pointer == NULL) {<br>
> + if (mkdir(path, 0777) ==
0 || errno == EEXIST)<br>
> +
return 0;<br>
> + if (errno != ENOENT)<br>
> +
return -1;<br>
> + }<br>
> + else {<br>
> + (void) closedir
(dir_pointer);<br>
> + }<br>
> cur_end = p = xstrdup(path);<br>
> <br>
> for (;;) {<br>
> @@ -202,9 +209,15 @@<br>
> * ENOENT
can only happen if something else races us,<br>
> * in
which case we should better give up.<br>
> */<br>
> - if (mkdir(p,
0777) == -1 && errno != EEXIST) {<br>
> -
free(p);<br>
> -
return -1;<br>
> + dir_pointer
= opendir (p);<br>
> + if (dir_pointer
== NULL) {<br>
> +
if (mkdir(p, 0777) == -1 && errno != EEXIST) {<br>
> +
free(p);<br>
> +
return -1;<br>
> +
}<br>
> + }<br>
> + else {<br>
> +
(void) closedir (dir_pointer);<br>
> }<br>
> if
(done)<br>
>
break;<br>
</font></tt>
--=_alternative 00776EAAC1257980_=--
Home |
Main Index |
Thread Index |
Old Index