From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio M. Di Nitto Date: Mon, 3 Nov 2008 05:55:45 +0100 (CET) Subject: [Cluster-devel] Re: [Linux-cluster] Fw: Building error in Cluster 2.03.09 In-Reply-To: <0d9d01c93b49$a5a81fc0$a401a8c0@mainoffice.nodex.ru> References: <0d9d01c93b49$a5a81fc0$a401a8c0@mainoffice.nodex.ru> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, 31 Oct 2008, Pavel Kuzin wrote: > Hello! > > I`m trying to build cluster 2.03.09 against linux 2.6.27.4. > > When building have a error: > > upgrade.o: In function `upgrade_device_archive': > /root/newcluster/cluster-2.03.09/ccs/ccs_tool/upgrade.c:226: undefined > reference to `mkostemp' > collect2: ld returned 1 exit status > make[2]: *** [ccs_tool] Error 1 > make[2]: Leaving directory `/root/newcluster/cluster-2.03.09/ccs/ccs_tool' > make[1]: *** [all] Error 2 > make[1]: Leaving directory `/root/newcluster/cluster-2.03.09/ccs' > make: *** [ccs] Error 2 > > node2:~/newcluster/cluster-2.03.09# uname -a > Linux node2 2.6.27.4 #2 SMP Fri Oct 31 13:42:09 MSK 2008 i686 GNU/Linux > > Distro - Debian Etch > Seems mkostemp is available since glibc 2.7. > I have 2.6. > Can "mkostemp" be changed to another similar function? You can apply this patch or wait for the next relese: commit 6e8c492f8e8233bc5e295ae12322c40936279178 Author: Fabio M. Di Nitto Date: Mon Nov 3 05:52:39 2008 +0100 ccs: fix build with older glibc mkostemp has been introduced only in glibc 2.7. Switch to mkstemp. Signed-off-by: Fabio M. Di Nitto diff --git a/ccs/ccs_tool/upgrade.c b/ccs/ccs_tool/upgrade.c index b7cecf0..6a0e150 100644 --- a/ccs/ccs_tool/upgrade.c +++ b/ccs/ccs_tool/upgrade.c @@ -223,7 +223,7 @@ static int upgrade_device_archive(char *location){ memset(tmp_file, 0, 128); sprintf(tmp_file, "/tmp/ccs_tool_tmp_XXXXXX"); - tmp_fd = mkostemp(tmp_file, O_RDWR | O_CREAT |O_TRUNC); + tmp_fd = mkstemp(tmp_file); if(tmp_fd < 0){ fprintf(stderr, "Unable to create temporary archive: %s\n", strerror(errno)); error = -errno; -- I'm going to make him an offer he can't refuse.