~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/doveadm/doveadm-mount.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
 
4
#include "master-service-settings.h"
4
5
#include "mountpoint-list.h"
5
6
#include "doveadm.h"
6
7
#include "doveadm-print.h"
13
14
{
14
15
        const char *perm_path, *state_path;
15
16
 
16
 
        perm_path = t_strconcat(PKG_STATEDIR"/"MOUNTPOINT_LIST_FNAME, NULL);
17
 
        state_path = t_strconcat(doveadm_settings->base_dir,
 
17
        perm_path = t_strconcat(service_set->state_dir,
 
18
                                 "/"MOUNTPOINT_LIST_FNAME, NULL);
 
19
        state_path = t_strconcat(service_set->base_dir,
18
20
                                 "/"MOUNTPOINT_LIST_FNAME, NULL);
19
21
        return mountpoint_list_init(perm_path, state_path);
20
22
}
71
73
{
72
74
        struct mountpoint_list *mountpoints;
73
75
        struct mountpoint_list_rec rec;
 
76
        int ret = 0;
74
77
 
75
78
        if (argc > 3)
76
79
                mount_cmd_help(cmd_mount_add);
77
80
 
78
81
        mountpoints = mountpoint_list_get();
79
82
        if (argv[1] == NULL) {
80
 
                mountpoint_list_add_missing(mountpoints,
 
83
                ret = mountpoint_list_add_missing(mountpoints,
81
84
                        MOUNTPOINT_STATE_DEFAULT,
82
85
                        mountpoint_list_default_ignore_prefixes,
83
86
                        mountpoint_list_default_ignore_types);
91
94
                        rec.wildcard = TRUE;
92
95
                mountpoint_list_add(mountpoints, &rec);
93
96
        }
94
 
        (void)mountpoint_list_save(mountpoints);
 
97
        if (mountpoint_list_save(mountpoints) < 0)
 
98
                ret = -1;
95
99
        mountpoint_list_deinit(&mountpoints);
 
100
        if (ret < 0)
 
101
                doveadm_exit_code = EX_TEMPFAIL;
96
102
}
97
103
 
98
104
static void cmd_mount_remove(int argc, char *argv[])