BA_CONDITIONAL(HAVE_SGI_OS, $FALSEPRG)
fi
-if test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
+if test $HAVE_UNAME=yes -a x`uname -s` = xIRIX -o x`uname -s` = xIRIX64
then
BA_CONDITIONAL(HAVE_IRIX_OS, $TRUEPRG)
AC_DEFINE(HAVE_IRIX_OS)
Volume marked as purged.
- Print warning message if LANG environment variable does not specify
UTF-8.
+- New dot commands from Arno.
+ .update volume [enabled|disabled|*see below]
+ .show device=xxx lists information from one storage device, including
+ devices (I'm not even sure that information exists in the DIR...)
+ .move eject device=xxx mostly the same as 'unmount xxx' but perhaps with
+ better machine-readable output like "Ok" or "Error busy"
+ .move eject device=xxx toslot=yyy the same as above, but with a new
+ target slot. The catalog should be updated accordingly.
+ .move transfer device=xxx fromslot=yyy toslot=zzz
+
+
=== Migration from David ===
What I'd like to see:
Kern Sibbald
General:
+24Jun06
+- ========= Remove Accept Any Volume ========= directive.
+- Major cleanup and simplification of regress using shell functions
+ (more tests to be converted to new format)
+- Add detection of 64 bit Irix as indicated by user.
+- Increment catalog database id from 9 to 10.
+- Add a few of the new database fields to the various C++
+ structures.
+- Implement code to fill in the most important new fields (e.g.
+ Media Enable).
+- Ensure that most of the new fields are in create/get/insert/update.
+ More work to be done.
22Jun06
- Update some very old licenses in src/cats.
- Modify the database format for handling Migration jobs:
#ifdef HAVE_SQLITE
-#define BDB_VERSION 9
+#define BDB_VERSION 10
#include <sqlite.h>
#ifdef HAVE_SQLITE3
-#define BDB_VERSION 9
+#define BDB_VERSION 10
#include <sqlite3.h>
#ifdef HAVE_MYSQL
-#define BDB_VERSION 9
+#define BDB_VERSION 10
#include <mysql.h>
#ifdef HAVE_POSTGRESQL
-#define BDB_VERSION 9
+#define BDB_VERSION 10
#include <libpq-fe.h>
char cSchedTime[MAX_TIME_LENGTH];
char cStartTime[MAX_TIME_LENGTH];
char cEndTime[MAX_TIME_LENGTH];
+ char cRealEndTime[MAX_TIME_LENGTH];
/* Extra stuff not in DB */
int limit; /* limit records to display */
faddr_t rec_addr;
char VolumeName[MAX_NAME_LENGTH]; /* Volume name */
char MediaType[MAX_NAME_LENGTH]; /* Media type */
DBId_t PoolId; /* Pool id */
- time_t FirstWritten; /* Time Volume first written */
+ time_t FirstWritten; /* Time Volume first written this usage */
time_t LastWritten; /* Time Volume last written */
time_t LabelDate; /* Date/Time Volume labeled */
+ time_t InitialWrite; /* Date/Time Volume first written */
int32_t LabelType; /* Label (Bacula/ANSI/IBM) */
uint32_t VolJobs; /* number of jobs on this medium */
uint32_t VolFiles; /* Number of files */
uint32_t MaxVolFiles; /* Max files on Volume */
int32_t Recycle; /* recycle yes/no */
int32_t Slot; /* slot in changer */
+ int32_t Enabled; /* 0=disabled, 1=enabled, 2=archived */
int32_t InChanger; /* Volume currently in changer */
DBId_t StorageId; /* Storage record Id */
uint32_t EndFile; /* Last file on volume */
uint32_t EndBlock; /* Last block on volume */
+ uint32_t RecycleCount; /* Number of times recycled */
char VolStatus[20]; /* Volume status */
DBId_t DeviceId; /* Device where Vol last written */
DBId_t LocationId; /* Where Volume is -- user defined */
DBId_t ScratchPoolId; /* Where to move if scratch */
DBId_t RecyclePoolId; /* Where to move when recycled */
- int32_t Enabled; /* disabled=0, enabled=1, archived=2 */
/* Extra stuff not in DB */
faddr_t rec_addr; /* found record address */
/* Since the database returns times as strings, this is how we pass
char cFirstWritten[MAX_TIME_LENGTH]; /* FirstWritten returned from DB */
char cLastWritten[MAX_TIME_LENGTH]; /* LastWritten returned from DB */
char cLabelDate[MAX_TIME_LENGTH]; /* LabelData returned from DB */
+ char cInitialWrite[MAX_TIME_LENGTH]; /* InitialWrite returned from DB */
bool set_first_written;
bool set_label_date;
};
);
-- Initialize Version
-INSERT INTO Version (VersionId) VALUES (9);
+INSERT INTO Version (VersionId) VALUES (10);
END-OF-DATA
then
endfile integer not null default 0,
endblock bigint not null default 0,
LocationId integer default 0,
- recyclcount integer not null default 0,
+ recyclecount integer not null default 0,
initialwrite timestamp without time zone,
scratchpoolid integer default 0,
recyclepoolid integer default 0,
('p', 'Waiting on higher priority jobs');
-INSERT INTO Version (VersionId) VALUES (9);
+INSERT INTO Version (VersionId) VALUES (10);
-- Make sure we have appropriate permissions
-- Initialize Version
-INSERT INTO Version (VersionId) VALUES (9);
+INSERT INTO Version (VersionId) VALUES (10);
PRAGMA default_synchronous = OFF;
-- Initialize Version
-INSERT INTO Version (VersionId) VALUES (9);
+INSERT INTO Version (VersionId) VALUES (10);
PRAGMA default_synchronous = OFF;
"FirstWritten,LastWritten,VolStatus,InChanger,VolParts,"
"LabelType "
"FROM Media WHERE PoolId=%s AND MediaType='%s' AND VolStatus IN ('Full',"
- "'Recycle','Purged','Used','Append') "
+ "'Recycle','Purged','Used','Append') AND Enabled=1 "
"ORDER BY LastWritten LIMIT 1",
edit_int64(mr->PoolId, ed1), mr->MediaType);
item = 1;
"VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,Recycle,Slot,"
"FirstWritten,LastWritten,VolStatus,InChanger,VolParts,"
"LabelType "
- "FROM Media WHERE PoolId=%s AND MediaType='%s' AND VolStatus='%s' "
+ "FROM Media WHERE PoolId=%s AND MediaType='%s' AND Enabled=1 "
+ "AND VolStatus='%s' "
"%s "
"%s LIMIT %d",
edit_int64(mr->PoolId, ed1), mr->MediaType,
mr->VolStatus, changer, order, item);
}
+ Dmsg1(100, "fnextvol=%s\n", mdb->cmd);
if (!QUERY_DB(jcr, mdb, mdb->cmd)) {
db_unlock(mdb);
return 0;
mr->InChanger = str_to_int64(row[20]);
mr->VolParts = str_to_int64(row[21]);
mr->LabelType = str_to_int64(row[22]);
+ mr->Enabled = 1; /* ensured via query */
sql_free_result(mdb);
db_unlock(mdb);
} else {
Mmsg(mdb->cmd, "SELECT VolSessionId,VolSessionTime,"
"PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus,"
-"Type,Level,ClientId,Name "
+"Type,Level,ClientId,Name,PriorJobId,RealEndTime "
"FROM Job WHERE JobId=%s",
edit_int64(jr->JobId, ed1));
}
jr->JobLevel = (int)*row[11];
jr->ClientId = str_to_uint64(row[12]!=NULL?row[12]:(char *)"");
bstrncpy(jr->Name, row[13]!=NULL?row[13]:"", sizeof(jr->Name));
+ jr->PriorJobId = str_to_uint64(row[14]!=NULL?row[14]:(char *)"");
+ bstrncpy(jr->cRealEndTime, row[15]!=NULL?row[15]:"", sizeof(jr->cRealEndTime));
sql_free_result(mdb);
db_unlock(mdb);
"VolBytes,VolMounts,VolErrors,VolWrites,MaxVolBytes,VolCapacityBytes,"
"MediaType,VolStatus,PoolId,VolRetention,VolUseDuration,MaxVolJobs,"
"MaxVolFiles,Recycle,Slot,FirstWritten,LastWritten,InChanger,"
- "EndFile,EndBlock,VolParts,LabelType,LabelDate,StorageId "
+ "EndFile,EndBlock,VolParts,LabelType,LabelDate,StorageId,"
+ "Enabled,LocationId,RecycleCount,InitialWrite,"
+ "ScratchPoolId,RecyclePoolId "
"FROM Media WHERE MediaId=%s",
edit_int64(mr->MediaId, ed1));
} else { /* find by name */
"VolBytes,VolMounts,VolErrors,VolWrites,MaxVolBytes,VolCapacityBytes,"
"MediaType,VolStatus,PoolId,VolRetention,VolUseDuration,MaxVolJobs,"
"MaxVolFiles,Recycle,Slot,FirstWritten,LastWritten,InChanger,"
- "EndFile,EndBlock,VolParts,LabelType,LabelDate,StorageId "
+ "EndFile,EndBlock,VolParts,LabelType,LabelDate,StorageId,"
+ "Enabled,LocationId,RecycleCount,InitialWrite,"
+ "ScratchPoolId,RecyclePoolId "
"FROM Media WHERE VolumeName='%s'", mr->VolumeName);
}
bstrncpy(mr->cLabelDate, row[27]!=NULL?row[27]:"", sizeof(mr->cLabelDate));
mr->LabelDate = (time_t)str_to_utime(mr->cLabelDate);
mr->StorageId = str_to_int64(row[28]);
+ mr->Enabled = str_to_int64(row[29]);
+ mr->LocationId = str_to_int64(row[30]);
+ mr->RecycleCount = str_to_int64(row[31]);
+ bstrncpy(mr->cInitialWrite, row[32]!=NULL?row[32]:"", sizeof(mr->cInitialWrite));
+ mr->InitialWrite = (time_t)str_to_utime(mr->cInitialWrite);
+ mr->ScratchPoolId = str_to_int64(row[33]);
+ mr->RecyclePoolId = str_to_int64(row[34]);
+
ok = true;
}
} else {
Mmsg(mdb->cmd, "SELECT MediaId,VolumeName,Slot,PoolId,"
"MediaType,FirstWritten,LastWritten,LabelDate,VolJobs,"
"VolFiles,VolBlocks,VolMounts,VolBytes,VolErrors,VolWrites,"
- "VolCapacityBytes,VolStatus,Recycle,VolRetention,"
+ "VolCapacityBytes,VolStatus,Enabled,Recycle,VolRetention,"
"VolUseDuration,MaxVolJobs,MaxVolFiles,MaxVolBytes,InChanger,"
- "EndFile,EndBlock,VolParts,LabelType,StorageId"
+ "EndFile,EndBlock,VolParts,LabelType,StorageId,DeviceId,"
+ "LocationId,RecycleCount,InitialWrite,ScratchPoolId,RecyclePoolId"
" FROM Media WHERE Media.VolumeName='%s'", mdbr->VolumeName);
} else {
Mmsg(mdb->cmd, "SELECT MediaId,VolumeName,Slot,PoolId,"
"MediaType,FirstWritten,LastWritten,LabelDate,VolJobs,"
"VolFiles,VolBlocks,VolMounts,VolBytes,VolErrors,VolWrites,"
- "VolCapacityBytes,VolStatus,Recycle,VolRetention,"
+ "VolCapacityBytes,VolStatus,Enabled,Recycle,VolRetention,"
"VolUseDuration,MaxVolJobs,MaxVolFiles,MaxVolBytes,InChanger,"
- "EndFile,EndBlock,VolParts,LabelType,StorageId"
+ "EndFile,EndBlock,VolParts,LabelType,StorageId,DeviceId,"
+ "LocationId,RecycleCount,InitialWrite,ScratchPoolId,RecyclePoolId"
" FROM Media WHERE Media.PoolId=%s ORDER BY MediaId",
edit_int64(mdbr->PoolId, ed1));
}
} else {
if (mdbr->VolumeName[0] != 0) {
- Mmsg(mdb->cmd, "SELECT MediaId,VolumeName,VolStatus,"
+ Mmsg(mdb->cmd, "SELECT MediaId,VolumeName,VolStatus,Enabled,"
"VolBytes,VolFiles,VolRetention,Recycle,Slot,InChanger,MediaType,LastWritten "
"FROM Media WHERE Media.VolumeName='%s'", mdbr->VolumeName);
} else {
- Mmsg(mdb->cmd, "SELECT MediaId,VolumeName,VolStatus,"
+ Mmsg(mdb->cmd, "SELECT MediaId,VolumeName,VolStatus,Enabled,"
"VolBytes,VolFiles,VolRetention,Recycle,Slot,InChanger,MediaType,LastWritten "
"FROM Media WHERE Media.PoolId=%s ORDER BY MediaId",
edit_int64(mdbr->PoolId, ed1));
time_t ttime;
struct tm tm;
int stat;
- char ed1[50], ed2[50], ed3[50], ed4[50];
- char ed5[50], ed6[50], ed7[50], ed8[50];
+ char ed1[50], ed2[50], ed3[50], ed4[50];
+ char ed5[50], ed6[50], ed7[50], ed8[50];
+ char ed9[50], ed10[50], ed11[50];
Dmsg1(100, "update_media: FirstWritten=%d\n", mr->FirstWritten);
"VolWrites=%u,MaxVolBytes=%s,VolStatus='%s',"
"Slot=%d,InChanger=%d,VolReadTime=%s,VolWriteTime=%s,VolParts=%d,"
"LabelType=%d,StorageId=%s,PoolId=%s,VolRetention=%s,VolUseDuration=%s,"
- "MaxVolJobs=%d,MaxVolFiles=%d"
+ "MaxVolJobs=%d,MaxVolFiles=%d,Enabled=%d,LocationId=%s,"
+ "ScratchPoolId=%s,RecyclePoolId=%s,RecycleCount=%d"
" WHERE VolumeName='%s'",
mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1),
mr->VolMounts, mr->VolErrors, mr->VolWrites,
edit_uint64(mr->VolRetention, ed7),
edit_uint64(mr->VolUseDuration, ed8),
mr->MaxVolJobs, mr->MaxVolFiles,
+ mr->Enabled, edit_uint64(mr->LocationId, ed9),
+ edit_uint64(mr->ScratchPoolId, ed10),
+ edit_uint64(mr->RecyclePoolId, ed11),
+ mr->RecycleCount,
mr->VolumeName);
Dmsg1(400, "%s\n", mdb->cmd);
DELETE FROM Version;
-INSERT INTO Version (VersionId) VALUES (9);
+INSERT INTO Version (VersionId) VALUES (10);
END-OF-DATA
then
ALTER TABLE jobmedia DROP COLUMN Stripe;
-
-
CREATE TABLE Location (
LocationId SERIAL NOT NULL,
Location TEXT NOT NULL,
);
-INSERT INTO version (versionId) VALUES (9);
+DELETE FROM version;
+INSERT INTO version (versionId) VALUES (10);
vacuum;
DELETE FROM Version;
-INSERT INTO Version (VersionId) VALUES (9);
+INSERT INTO Version (VersionId) VALUES (10);
COMMIT;
DELETE FROM Version;
-INSERT INTO Version (VersionId) VALUES (9);
+INSERT INTO Version (VersionId) VALUES (10);
COMMIT;
{"tlscacertificatedir", store_dir, ITEM(res_cons.tls_ca_certdir), 0, 0, 0},
{"tlscertificate", store_dir, ITEM(res_cons.tls_certfile), 0, 0, 0},
{"tlskey", store_dir, ITEM(res_cons.tls_keyfile), 0, 0, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {NULL, NULL, {0}, 0, 0, 0}
};
{"tlscacertificatedir", store_dir, ITEM(res_dir.tls_ca_certdir), 0, 0, 0},
{"tlscertificate", store_dir, ITEM(res_dir.tls_certfile), 0, 0, 0},
{"tlskey", store_dir, ITEM(res_dir.tls_keyfile), 0, 0, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {NULL, NULL, {0}, 0, 0, 0}
};
/*
if (jcr->jr.PoolId != mr.PoolId) {
continue;
}
+ /* Don't prune archived volumes */
+ if (mr.Enabled == 2) {
+ continue;
+ }
/* Prune only Volumes with status "Full", or "Used" */
if (strcmp(mr.VolStatus, "Full") == 0 ||
strcmp(mr.VolStatus, "Used") == 0) {
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 365 days # one year
- Accept Any Volume = yes # write on any volume in the pool
}
#
if (label || mr.LabelDate == 0) {
mr.LabelDate = jcr->start_time;
mr.set_label_date = true;
+ if (mr.InitialWrite == 0) {
+ mr.InitialWrite = jcr->start_time;
+ }
Dmsg2(400, "label=%d labeldate=%d\n", label, mr.LabelDate);
} else {
/*
{"maximumvolumejobs", store_pint, ITEM(res_pool.MaxVolJobs), 0, 0, 0},
{"maximumvolumefiles", store_pint, ITEM(res_pool.MaxVolFiles), 0, 0, 0},
{"maximumvolumebytes", store_size, ITEM(res_pool.MaxVolBytes), 0, 0, 0},
- {"acceptanyvolume", store_bool, ITEM(res_pool.accept_any_volume), 0, ITEM_DEFAULT, true},
{"catalogfiles", store_bool, ITEM(res_pool.catalog_files), 0, ITEM_DEFAULT, true},
{"volumeretention", store_time, ITEM(res_pool.VolRetention), 0, ITEM_DEFAULT, 60*60*24*365},
{"volumeuseduration", store_time, ITEM(res_pool.VolUseDuration), 0, 0, 0},
case R_POOL:
sendit(sock, _("Pool: name=%s PoolType=%s\n"), res->res_pool.hdr.name,
res->res_pool.pool_type);
- sendit(sock, _(" use_cat=%d use_once=%d acpt_any=%d cat_files=%d\n"),
+ sendit(sock, _(" use_cat=%d use_once=%d cat_files=%d\n"),
res->res_pool.use_catalog, res->res_pool.use_volume_once,
- res->res_pool.accept_any_volume, res->res_pool.catalog_files);
+ res->res_pool.catalog_files);
sendit(sock, _(" max_vols=%d auto_prune=%d VolRetention=%s\n"),
res->res_pool.max_volumes, res->res_pool.AutoPrune,
edit_utime(res->res_pool.VolRetention, ed1, sizeof(ed1)));
bool use_catalog; /* maintain catalog for media */
bool catalog_files; /* maintain file entries in catalog */
bool use_volume_once; /* write on volume only once */
- bool accept_any_volume; /* accept any volume */
bool purge_oldest_volume; /* purge oldest volume */
bool recycle_oldest_volume; /* attempt to recycle oldest volume */
bool recycle_current_volume; /* attempt recycle of current volume */
goto bail_out;
}
pr.NumVols++;
+ mr->Enabled = 1;
if (db_create_media_record(jcr, jcr->db, mr) &&
db_update_pool_record(jcr, jcr->db, &pr)) {
db_unlock(jcr->db);
* 1. Look for volume with "Append" status.
*/
ok = db_find_next_volume(jcr, jcr->db, index, InChanger, mr);
- Dmsg2(100, "catreq after find_next_vol ok=%d FW=%d\n", ok, mr->FirstWritten);
+ Dmsg4(100, "after find_next_vol index=%d ok=%d InChanger=%d Vstat=%s\n",
+ index, ok, InChanger, mr->VolStatus);
if (!ok) {
/*
* 2. Try finding a recycled volume
*/
ok = find_recycled_volume(jcr, InChanger, mr);
- Dmsg2(100, "find_recycled_volume %d FW=%d\n", ok, mr->FirstWritten);
+ Dmsg2(100, "find_recycled_volume ok=%d FW=%d\n", ok, mr->FirstWritten);
if (!ok) {
/*
* 3. Try recycling any purged volume
/* ua_prune.c */
int prune_files(UAContext *ua, CLIENT *client);
int prune_jobs(UAContext *ua, CLIENT *client, int JobType);
-int prune_volume(UAContext *ua, MEDIA_DBR *mr);
+bool prune_volume(UAContext *ua, MEDIA_DBR *mr);
/* ua_purge.c */
bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr);
const char *select =
"SELECT MediaId,LastWritten FROM Media "
"WHERE PoolId=%s AND Recycle=1 AND VolStatus='Purged' "
- "AND MediaType='%s' %s"
+ "AND Enabled=1 AND MediaType='%s' %s"
"ORDER BY LastWritten ASC,MediaId LIMIT 1";
Dmsg0(100, "Enter recycle_oldest_purged_volume\n");
mr->MaxVolFiles = pr->MaxVolFiles;
mr->MaxVolBytes = pr->MaxVolBytes;
mr->LabelType = pr->LabelType;
+ mr->Enabled = 1;
}
mr.Slot = Slot++;
mr.InChanger = InChanger;
mr.StorageId = store->StorageId;
+ mr.Enabled = 1;
Dmsg1(200, "Create Volume %s\n", mr.VolumeName);
if (!db_create_media_record(ua->jcr, ua->db, &mr)) {
bsendmsg(ua, "%s", db_strerror(ua->db));
pr->LabelType = pool->LabelType;
pr->UseOnce = pool->use_volume_once;
pr->UseCatalog = pool->use_catalog;
- pr->AcceptAnyVolume = pool->accept_any_volume;
pr->Recycle = pool->Recycle;
pr->VolRetention = pool->VolRetention;
pr->VolUseDuration = pool->VolUseDuration;
bsendmsg(ua, "pool_type=%s", pool->pool_type);
bsendmsg(ua, "label_format=%s", pool->label_format?pool->label_format:"");
bsendmsg(ua, "use_volume_once=%d", pool->use_volume_once);
- bsendmsg(ua, "accept_any_volume=%d", pool->accept_any_volume);
bsendmsg(ua, "purge_oldest_volume=%d", pool->purge_oldest_volume);
bsendmsg(ua, "recycle_oldest_volume=%d", pool->recycle_oldest_volume);
bsendmsg(ua, "recycle_current_volume=%d", pool->recycle_current_volume);
mr->VolBytes = 1; /* flag indicating Volume labeled */
mr->InChanger = 1;
mr->StorageId = ua->jcr->store->StorageId;
+ mr->Enabled = 1;
if (db_create_media_record(ua->jcr, ua->db, mr)) {
bsendmsg(ua, _("Catalog record for Volume \"%s\", Slot %d successfully created.\n"),
mr->VolumeName, mr->Slot);
/*
* Prune a given Volume
*/
-int prune_volume(UAContext *ua, MEDIA_DBR *mr)
+bool prune_volume(UAContext *ua, MEDIA_DBR *mr)
{
POOLMEM *query = get_pool_memory(PM_MESSAGE);
struct s_count_ctx cnt;
struct s_file_del_ctx del;
- int i, stat = 0;
+ int i;
+ bool ok = false;
JOB_DBR jr;
utime_t now, period;
char ed1[50];
+ if (mr->Enabled == 2) {
+ return false; /* Cannot prune archived volumes */
+ }
+
db_lock(ua->db);
memset(&jr, 0, sizeof(jr));
memset(&del, 0, sizeof(del));
if (strcmp(mr->VolStatus, "Append") == 0 && verbose) {
bsendmsg(ua, _("There are no Jobs associated with Volume \"%s\". Prune not needed.\n"),
mr->VolumeName);
- stat = 1;
+ ok = true;
goto bail_out;
}
/* If volume not already purged, do so */
bsendmsg(ua, _("There are no Jobs associated with Volume \"%s\". Marking it purged.\n"),
mr->VolumeName);
}
- stat = mark_media_purged(ua, mr);
+ ok = mark_media_purged(ua, mr);
goto bail_out;
}
}
if (cnt.count == 0) {
Dmsg0(200, "Volume is purged.\n");
- stat = mark_media_purged(ua, mr);
+ ok = mark_media_purged(ua, mr);
}
bail_out:
db_unlock(ua->db);
free_pool_memory(query);
- return stat;
+ return ok;
}
{"tlscacertificatedir", store_dir, ITEM(res_client.tls_ca_certdir), 0, 0, 0},
{"tlscertificate", store_dir, ITEM(res_client.tls_certfile), 0, 0, 0},
{"tlskey", store_dir, ITEM(res_client.tls_keyfile), 0, 0, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {NULL, NULL, {0}, 0, 0, 0}
};
/* Directors that can use our services */
{"tlskey", store_dir, ITEM(res_dir.tls_keyfile), 0, 0, 0},
{"tlsdhfile", store_dir, ITEM(res_dir.tls_dhfile), 0, 0, 0},
{"tlsallowedcn", store_alist_str, ITEM(res_dir.tls_allowed_cns), 0, 0, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {NULL, NULL, {0}, 0, 0, 0}
};
/* Message resource */
{
int errstat;
- if ((errstat=pthread_mutex_tryunlock(m)) == 0) {
+ /* Note, this trylock *should* fail if the mutex is locked */
+ if ((errstat=pthread_mutex_trylock(m)) == 0) {
berrno be;
e_msg(file, line, M_ERROR, 0, _("Mutex unlock not locked. ERR=%s\n"),
be.strerror(errstat));
{"tlskey", store_dir, ITEM(res_store.tls_keyfile), 0, 0, 0},
{"tlsdhfile", store_dir, ITEM(res_store.tls_dhfile), 0, 0, 0},
{"tlsallowedcn", store_alist_str, ITEM(res_store.tls_allowed_cns), 0, 0, 0},
- {NULL, NULL, 0, 0, 0, 0}
+ {NULL, NULL, {0}, 0, 0, 0}
};
{"tlskey", store_dir, ITEM(res_dir.tls_keyfile), 0, 0, 0},
{"tlsdhfile", store_dir, ITEM(res_dir.tls_dhfile), 0, 0, 0},
{"tlsallowedcn", store_alist_str, ITEM(res_dir.tls_allowed_cns), 0, 0, 0},
- {NULL, NULL, 0, 0, 0, 0}
+ {NULL, NULL, {0}, 0, 0, 0}
};
/* Device definition */
{"writepartcommand", store_strname,ITEM(res_dev.write_part_command), 0, 0, 0},
{"freespacecommand", store_strname,ITEM(res_dev.free_space_command), 0, 0, 0},
{"labeltype", store_label, ITEM(res_dev.label_type), 0, 0, 0},
- {NULL, NULL, 0, 0, 0, 0}
+ {NULL, NULL, {0}, 0, 0, 0}
};
/* Autochanger definition */
{"device", store_alist_res, ITEM(res_changer.device), R_DEVICE, ITEM_REQUIRED, 0},
{"changerdevice", store_strname, ITEM(res_changer.changer_name), 0, ITEM_REQUIRED, 0},
{"changercommand", store_strname, ITEM(res_changer.changer_command), 0, ITEM_REQUIRED, 0},
- {NULL, NULL, 0, 0, 0, 0}
+ {NULL, NULL, {0}, 0, 0, 0}
};