- struct passwd *pw;
- char *dumpuser;
- disklist_t *diskqp;
- char *conffile;
- char *conf_diskfile;
- char *conf_infofile;
-
- safe_fd(-1, 0);
- safe_cd();
-
- set_pname("amcleanupdisk");
-
- if(main_argc != 2) {
- error("Usage: amcleanupdisk%s <confdir>", versionsuffix());
- }
-
- config_name = main_argv[1];
-
- config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
- conffile = stralloc2(config_dir, CONFFILE_NAME);
- if(read_conffile(conffile)) {
- error("errors processing config file \"%s\"", conffile);
- }
- amfree(conffile);
- conf_diskfile = getconf_str(CNF_DISKFILE);
- if (*conf_diskfile == '/') {
- conf_diskfile = stralloc(conf_diskfile);
- } else {
- conf_diskfile = stralloc2(config_dir, conf_diskfile);
- }
- if((diskqp = read_diskfile(conf_diskfile)) == NULL) {
- error("could not load disklist %s", conf_diskfile);
- }
- amfree(conf_diskfile);
- conf_infofile = getconf_str(CNF_INFOFILE);
- if (*conf_infofile == '/') {
- conf_infofile = stralloc(conf_infofile);
- } else {
- conf_infofile = stralloc2(config_dir, conf_infofile);
- }
- if(open_infofile(conf_infofile)) {
- error("could not open info db \"%s\"", conf_infofile);
+ char *conf_infofile = config_dir_relative(getconf_str(CNF_INFOFILE));
+ if (open_infofile(conf_infofile) < 0) {
+ error(_("could not open info db \"%s\""), conf_infofile);
+ /*NOTREACHED*/