Skip to contentSkip to conversation

Building error in Cluster 2.03.09

Cluster-devel Lon Hohberger 2 participants 3 messages Oct 31, 2008 – Nov 3, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · Pavel Kuzin
 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

Maybe...

Quoted 3 lines

Seems mkostemp is available since glibc 2.7. I have 2.6.
Can "mkostemp" be changed to another similar function?

#define mkostemp(val, flags) mkstemp(val)

?

Man page:

int mkstemp(char *template);
int mkostemp (char *template, int flags);

...

mkostemp() is like mkstemp(), with the difference that flags as for open(2) may be specified in flags (e.g., O_APPEND, O_SYNC).

Not sure the implications of doing this; I didn't analyze the open flags used.

-- Lon

#2 lore raw
In reply to a message not in the archive
Quoted 16 lines · Pavel Kuzin

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

Quoted 7 lines
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?

Probably, I'll have a look on monday.

Fabio

--
I'm going to make him an offer he can't refuse.

#3 lore raw
In reply to a message not in the archive
Quoted 16 lines · Pavel Kuzin

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

Quoted 7 lines
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 <[email protected]>
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.

ccs/ccs_tool/upgrade.c +1 -1
index b7cecf0..6a0e150 100644
@@ -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.