IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4639


Ignore:
Timestamp:
Jul 27, 2005, 6:13:32 PM (21 years ago)
Author:
jhoblitt
Message:

nebOpen(server, key, NEB_WRITE) is not allowed when object has multiple instances

Location:
trunk/Nebulous/nebclient
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/nebclient/src/nebclient.c

    r4637 r4639  
    44 * Copyright (C) 2005  Joshua Hoblitt
    55 *
    6  * $Id: nebclient.c,v 1.28 2005-07-28 02:55:20 jhoblitt Exp $
     6 * $Id: nebclient.c,v 1.29 2005-07-28 04:13:32 jhoblitt Exp $
    77 */
    88
     
    311311    char            **locations;
    312312    char            *filename;
     313    int             instances;
    313314    int             fh;
    314315
    315     if (nebFindInstances(server, key, NULL, &locations) < 0) {
     316    instances = nebFindInstances(server, key, NULL, &locations);
     317    if (instances < 1) {
    316318        nebSetErr(server, "no instances found");
    317319
     
    326328
    327329    if (flag == NEB_WRITE) {
     330        if (instances > 1) {
     331            nebSetErr(server, "write not allowed with multiple instances");
     332            nebFree(filename);
     333
     334            return -1;
     335        }
    328336        fh = open(filename, O_RDWR);
    329337    } else {
  • trunk/Nebulous/nebclient/tests/tests.c

    r4636 r4639  
    2121    char            *key = "foobarbaz";
    2222
    23     TESTS(16);
     23    TESTS(17);
    2424
    2525    if (getenv("NEBULOUS_SERVER")) {
     
    4343
    4444    OK(nebReplicate(server, key, NULL, NULL), "replicate object");
     45
     46    OK(nebOpen(server, key, NEB_WRITE) < 0, "write to object with multiple instances");
    4547
    4648    OK(nebCull(server, key), "cull object");
Note: See TracChangeset for help on using the changeset viewer.