[358] in SIPB_Linux_Development

home help back first fref pref prev next nref lref last post

zwgc bug that appears under Linux

daemon@ATHENA.MIT.EDU (Erik Nygren)
Wed Jan 26 02:13:03 1994

To: bugs@MIT.EDU
Cc: linux-dev@MIT.EDU, marc@MIT.EDU
Date: Wed, 26 Jan 94 02:12:33 EST
From: Erik Nygren <nygren@MIT.EDU>


In the file port.c in zwgc, the function create_file_append_port
contains the code:

-----------
    errno = 0;

    oumask = umask(077);                /* allow read/write for us only */
    out = fopen(filename, "a");
    (void) umask(oumask);
    if (errno) {
        var_set_variable("error", perror_to_string(errno));
        return;
    }

    create_port_from_files(name, 0, out);

-----------

Under Linux, fopen(file,"a") sets errno to non-zero
if the file already exists, even though it has opened the
file properly.  As a result, the function exits
and create_port_from_files doesn't get run.  The end result
is that appendport in a .zwgc.desc file then does not
work if the file already exists.  This problem doesn't
appear on at least dec's.  I haven't tried other machines.

--- Erik Nygren

___________________________________________________________________________
 The most exciting phrase to hear in | Erik L. Nygren
 science, the one that heralds new   |
 discoveries, is not "Eureka!" (I've | VOICE: 617/225-9395
 found it!) but "That's funny ..."   |
                -- Isaac Asimov      | EMAIL: <nygren@mit.edu>

home help back first fref pref prev next nref lref last post