Bug#569610: omhacks FTBFS: open O_CREAT needs 3 arguments

2010-02-24 Thread Timo Juhani Lindfors

Isn't O_CREAT a mistake since we never create new files under /sys
anyway?




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#569610: omhacks FTBFS: open O_CREAT needs 3 arguments

2010-02-12 Thread Kamal Mostafa
Package: omhacks
Version: 0.8-1
Severity: important
Tags: patch
Justification: fails to build from source
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu karmic ubuntu-patch


https://bugs.launchpad.net/ubuntu/+source/omhacks/+bug/521164

http://launchpadlibrarian.net/39017735/buildlog_ubuntu-lucid-i386.omhacks_0.8-1_FAILEDTOBUILD.txt.gz

cd /build/buildd/omhacks-0.8/obj-i486-linux-gnu/omhacks && /usr/bin/gcc 
-Domhacks_EXPORTS -g -O2 -fPIC -I/build/buildd/omhacks-0.8/omhacks/.. -Wall 
-Werror -o CMakeFiles/omhacks.dir/sysfs.c.o -c 
/build/buildd/omhacks-0.8/omhacks/sysfs.c
In file included from /usr/include/fcntl.h:205,
 from /build/buildd/omhacks-0.8/omhacks/sysfs.c:28:
In function 'open',
inlined from 'om_sysfs_writefile' at 
/build/buildd/omhacks-0.8/omhacks/sysfs.c:194:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared 
with attribute error: open with O_CREAT in second argument needs 3 arguments
make[3]: *** [omhacks/CMakeFiles/omhacks.dir/sysfs.c.o] Error 1

---

In Ubuntu, we've applied the attached patch to achieve the following:

  * Fix FTBFS: sysfs.c open with O_CREAT needs 3 arguments (LP: #521164)

We thought you might be interested in doing the same. 
--- omhacks-0.8.orig/omhacks/sysfs.c
+++ omhacks-0.8/omhacks/sysfs.c
@@ -191,7 +191,8 @@
size_t ssize = strlen(str);
ssize_t count;
int fd = -1;
-   fd = open(pathname, O_WRONLY | O_CREAT);
+   fd = open(pathname, O_WRONLY | O_CREAT,
+   S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR|S_IWGRP|S_IWOTH);
if (fd < 0) return fd;
count = write(fd, str, ssize);
if (count != ssize)