IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16338


Ignore:
Timestamp:
Feb 6, 2008, 10:33:18 AM (18 years ago)
Author:
Paul Price
Message:

Removing entire concept of specifying a protocol to psMessageDestination.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psLogMsg.c

    r16337 r16338  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2008-02-06 20:30:49 $
     13 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2008-02-06 20:33:18 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    195195    }
    196196
    197     // Destination is protocol:location
    198     psList *protocolLocation = psStringSplit(dest, ":", false); // A list containing the protocol and location
    199     const char *protocol, *location;    // Protocol and location for message
    200     if (protocolLocation->n == 1) {
    201         // "file" is the default protocol --- use it if no protocol is specified.
    202         protocol = "file";
    203         location = psListGet(protocolLocation, PS_LIST_TAIL); // The location
    204     } else if (protocolLocation->n != 2) {
    205         psFree(protocolLocation);
    206         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to parse protocol:location from: %s\n", dest);
     197    int fileD = creat(dest, 0666);
     198    if (fileD == 0) {
     199        psError(PS_ERR_IO, true, _("Could not open file '%s' for output."), dest);
    207200        return -1;
    208     } else {
    209         protocol = psListGet(protocolLocation, PS_LIST_HEAD);
    210         location = psListGet(protocolLocation, PS_LIST_TAIL);
    211     }
    212 
    213     if (strcasecmp(protocol, "file") == 0) {
    214         int fileD = creat(location, 0666);
    215 
    216         if (fileD == 0) {
    217             psError(PS_ERR_IO, true, _("Could not open file '%s' for output."),
    218                     location);
    219             psFree(protocolLocation);
    220             return -1;
    221         }
    222         psFree(protocolLocation);
    223         return fileD;
    224     }
    225 
    226     psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised protocol: %s\n", protocol);
    227     psFree(protocolLocation);
    228     return -1;
     201    }
     202    return fileD;
    229203}
    230204
Note: See TracChangeset for help on using the changeset viewer.