~ubuntu-branches/ubuntu/quantal/zfs-fuse/quantal

« back to all changes in this revision

Viewing changes to src/lib/libumem/envvar.c

  • Committer: Bazaar Package Importer
  • Author(s): Mike Hommey, Mike Hommey, Seth Heeren
  • Date: 2010-06-30 18:03:52 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100630180352-d3jq25ytbcl23q3y
Tags: 0.6.9-1
* New upstream release.

[ Mike Hommey ]
* debian/control:
  - Build depend on libssl-dev and libattr1-dev, now required to build.
  - Build depend on docbook-xml to avoid xsltproc I/O error loading
    docbook DTD.
  - Add suggestions for a NFS server and kpartx.
* debian/man/*, debian/copyright, debian/rules: Remove manual pages, they
  are now shipped upstream.
* debian/copyright: Change download link.
* src/SConstruct:
  - Add an optim option to the build system.
  - Add support for DESTDIR.
  - Force debug=1 to mean optim, no strip, no debug.
  - Use -ffunction-sections, -fdata-sections, and --gc-sections flags to
    reduce the binary sizes.
* src/lib/libumem/SConscript: Cleanup src/lib/libumem when cleaning up
  build directory.
* src/cmd/*/SConscript: Don't link zfs, zpool and zdb against libssl.
* src/lib/libumem/SConscript: Only build static libumem.
* src/lib/libumem/sol_compat.h:
  - Add atomic cas support for sparc.
  - Use atomic functions from libsolcompat in libumem on unsupported
    platforms.
* debian/rules:
  - Set optimization level in build system according to DEB_BUILD_OPTIONS.
  - Build with debug=1 to have unstripped binaries ; dh_strip will do the
    right thing.
  - Don't depend on the local location of the docbook XSLT stylesheets.
    Use the catalogged url in place of the full path.
  - Don't clean src/.sconsign.dblite and src/path.pyc.
  - Set all destination directories when installing with scons.
  - Install bash completion and zfsrc files.
  - Don't use scons cache when building.
* debian/prerm: Remove /var/lib/zfs/zpool.cache in prerm.
* debian/dirs: Create /etc/bash_completion.d.
* debian/watch: Fix watch file.
* debian/rules, debian/control, debian/compat: Switch to dh.
* debian/README.Debian: Update README.Debian.
* debian/zfs-fuse.man.xml: Update zfs-fuse manual page.
* debian/zfs-fuse.init: Start sharing datasets marked as such at daemon
  startup.
* debian/rules, debian/control: Use config.guess and config.sub from
  autotools-dev.

[ Seth Heeren ]
* debian/zfs-fuse.man.xml:
  Added notes on the precedence, zfsrc, commandline, initscript vs.
  /etc/default/zfs-fuse on some systems.
* debian/zfs-fuse.init, debian/zfs-fuse.default: Deprecating DAEMON_OPTS.
* debian/zfs-fuse.init:
  - Removing import -a -f.
  - Removing the now unnecessary 'sleep 2'.
  - Extended shutdown wait to allow for zfs-fuse daemon's own shutdown
    timeouts.
  - Re-ordered dubious PATH setting.
* debian/zfs-fuse.init: Move existing zpool.cache to new location if
  possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * Use is subject to license terms.
25
25
 */
26
26
/*
27
 
 * Portions Copyright 2006 OmniTI, Inc.
 
27
 * Portions Copyright 2006-2008 Message Systems, Inc.
28
28
 */
29
29
 
30
30
/* #pragma ident        "@(#)envvar.c   1.5     05/06/08 SMI" */
93
93
static arg_process_t umem_backend_process;
94
94
#endif
95
95
 
 
96
#ifdef __GLIBC__
 
97
/* replace getenv() with a specialized version that doesn't
 
98
 * need to allocate memory.  We can't use strlen or strcmp
 
99
 * here. */
 
100
#include <unistd.h>
 
101
static char *safe_getenv(const char *name)
 
102
{
 
103
        int i, l;
 
104
        for (l = 0; name[l]; l++)
 
105
                ;
 
106
        for (i = 0; __environ[i]; i++) {
 
107
                if (!memcmp(__environ[i], name, l) && __environ[i][l] == '=') {
 
108
                        return &__environ[i][l+1];
 
109
                }
 
110
        }
 
111
        return NULL;
 
112
}
 
113
#define getenv(x) safe_getenv(x)
 
114
#endif
 
115
 
96
116
static arg_process_t umem_log_process;
97
117
 
98
118
const char *____umem_environ_msg_options = "-- UMEM_OPTIONS --";
437
457
        case ITEM_SIZE:
438
458
                arg_required = 1;
439
459
                break;
440
 
 
441
 
        default:
442
 
                log_message("%s: %s: Invalid type.  Ignored\n",
443
 
                    CURRENT, item->item_name);
444
 
                return (1);
445
460
        }
446
461
 
447
462
        switch (item->item_type) {
558
573
        static volatile enum {
559
574
                STATE_START,
560
575
                STATE_GETENV,
 
576
                STATE_DLOPEN,
561
577
                STATE_DLSYM,
562
578
                STATE_FUNC,
563
579
                STATE_DONE
582
598
                        where = "during getenv(3C) calls -- "
583
599
                            "getenv(3C) results ignored.";
584
600
                        break;
 
601
                case STATE_DLOPEN:
 
602
                        where = "during dlopen(3C) call -- "
 
603
                            "_umem_*() results ignored.";
 
604
                        break;
585
605
                case STATE_DLSYM:
586
606
                        where = "during dlsym(3C) call -- "
587
607
                            "_umem_*() results ignored.";
628
648
# define dlclose(a)             0
629
649
# define dlerror()              0
630
650
#endif
 
651
        state = STATE_DLOPEN;
631
652
        /* get a handle to the "a.out" object */
632
653
        if ((h = dlopen(0, RTLD_FIRST | RTLD_LAZY)) != NULL) {
633
654
                for (cur_env = umem_envvars; cur_env->env_name != NULL;