[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: rebuild fails, previous build worked, c open macro bug?



On Thu, Aug 23, 2007 at 02:46:08PM +0200, Till Maas wrote:
> one of my packages does not want to be built, the error message is:
> 
> 
> gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_FILE_OFFSET_BITS=64 -D_REVISION=`./evalrev` 
> src/aireplay-ng.c src/common.c src/crc.c -o aireplay-ng
> src/aireplay-ng.c: In function 'open_sysnofcs':
> src/aireplay-ng.c:327: error: size of array '__open_missing_mode' is negative
> gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_FILE_OFFSET_BITS=64 -D_REVISION=`./evalrev` 
> src/airodump-ng.c src/common.c -o airodump-ng

    /* look for the location of inject_nofcs */
    FILE * search_inject = popen("find /sys/devices -name *inject_nofcs", "r");
    if(fgets(location, sizeof location, search_inject)) {
        /* replace the newline on the end by \0 */
        newline = strrchr(location, '\n');
        if (newline) *newline = '\0';

        /* try to open the file we found */
        dev.nofcs = open(location, O_WRONLY | O_CREAT);
        if (dev.nofcs < 0) {
            printf("Opening file '%s': ", location);
            perror("couldn't open file");
        }
    }else {
        printf("Couldn't find the location of inject_nofcs. Is your bcm34xx driver patched?\n");
    }

O_CREAT without a 3rd argument is invalid.  But in this case, if the file
doesn't exist, find /sys/devices wouldn't find it IMNSHO.  So I'd just
drop that | O_CREAT.

	Jakub


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]