~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to db/os_vxworks/os_abs.c

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-
 
2
 * See the file LICENSE for redistribution information.
 
3
 *
 
4
 * Copyright (c) 1997-2001
 
5
 *      Sleepycat Software.  All rights reserved.
 
6
 */
 
7
 
 
8
#include "db_config.h"
 
9
 
 
10
#ifndef lint
 
11
static const char revid[] = "$Id: os_abs.c,v 1.6 2001/05/23 14:47:23 sue Exp $";
 
12
#endif /* not lint */
 
13
 
 
14
#include "db_int.h"
 
15
#include "iosLib.h"
 
16
 
 
17
/*
 
18
 * __os_abspath --
 
19
 *      Return if a path is an absolute path.
 
20
 */
 
21
int
 
22
__os_abspath(path)
 
23
        const char *path;
 
24
{
 
25
        DEV_HDR *dummy;
 
26
        char *ptail;
 
27
 
 
28
        /*
 
29
         * VxWorks devices can be rooted at any name at all.
 
30
         * Use iosDevFind() to see if name matches any of our devices.
 
31
         */
 
32
        if ((dummy = iosDevFind((char *)path, &ptail)) == NULL)
 
33
                return (0);
 
34
        /*
 
35
         * If the routine used a device, then ptail points to the
 
36
         * rest and we are an abs path.
 
37
         */
 
38
        if (ptail != path)
 
39
                return (1);
 
40
        /*
 
41
         * If the path starts with a '/', then we are an absolute path,
 
42
         * using the host machine, otherwise we are not.
 
43
         */
 
44
        return (path[0] == '/');
 
45
}