From 51fafa4e20d58f8d0c58b307db6fd5f064e89c4c Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 5 Apr 2010 22:08:02 +0200 Subject: [PATCH] Change cryptic aop name --- bacula/src/baconfig.h | 2 +- bacula/src/dird/dird_conf.c | 5 ++--- bacula/src/dird/ua_purge.c | 2 +- bacula/src/dird/ua_update.c | 23 +++++++++++------------ bacula/src/lib/protos.h | 2 +- bacula/src/lib/util.c | 4 ++-- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index 5d3036a942..cfe2a3c40f 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -356,7 +356,7 @@ void InitWinAPIWrapper(); /** * Actions on purge (bit mask) */ -#define AOP_TRUNCATE 1 +#define ON_PURGE_TRUNCATE 1 /* Size of File Address stored in STREAM_SPARSE_DATA. Do NOT change! */ #define SPARSE_FADDR_SIZE (sizeof(uint64_t)) diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index da7db73446..ca1d5f9ab4 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + Copyright (C) 2000-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -46,7 +46,6 @@ * * Kern Sibbald, January MM * - * Version $Id$ */ @@ -1622,7 +1621,7 @@ static void store_actiononpurge(LEX *lc, RES_ITEM *item, int index, int pass) uint32_t *destination = (uint32_t*)item->value; lex_get_token(lc, T_NAME); if (strcasecmp(lc->str, "truncate") == 0) { - *destination = (*destination) | AOP_TRUNCATE; + *destination = (*destination) | ON_PURGE_TRUNCATE; } else { scan_err2(lc, _("Expected one of: %s, got: %s"), "Truncate", lc->str); return; diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index 1b7fc0f0e1..7d1dd4621d 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -589,7 +589,7 @@ static void do_truncate_on_purge(UAContext *ua, MEDIA_DBR *mr, return; } - if (mr->ActionOnPurge & AOP_TRUNCATE) { + if (mr->ActionOnPurge & ON_PURGE_TRUNCATE) { /* Send the command to truncate the volume after purge. If this feature * is disabled for the specific device, this will be a no-op. */ diff --git a/bacula/src/dird/ua_update.c b/bacula/src/dird/ua_update.c index d430fda8cf..7728baf01c 100644 --- a/bacula/src/dird/ua_update.c +++ b/bacula/src/dird/ua_update.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + Copyright (C) 2000-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -32,7 +32,6 @@ * * Kern Sibbald, September MM * - * Version $Id$ */ #include "bacula.h" @@ -478,7 +477,7 @@ static void update_vol_actiononpurge(UAContext *ua, char *val, MEDIA_DBR *mr) { POOL_MEM ret; if (strcasecmp(val, "truncate") == 0) { - mr->ActionOnPurge = AOP_TRUNCATE; + mr->ActionOnPurge = ON_PURGE_TRUNCATE; } else { mr->ActionOnPurge = 0; } @@ -488,7 +487,7 @@ static void update_vol_actiononpurge(UAContext *ua, char *val, MEDIA_DBR *mr) db_strerror(ua->db)); } else { ua->info_msg(_("New ActionOnPurge is: %s\n"), - aop_to_str(mr->ActionOnPurge, ret)); + action_on_purge_to_string(mr->ActionOnPurge, ret)); } } @@ -587,9 +586,9 @@ static int update_volume(UAContext *ua) case 13: update_vol_recyclepool(ua, ua->argv[j], &mr); break; - case 14: - update_vol_actiononpurge(ua, ua->argv[j], &mr); - break; + case 14: + update_vol_actiononpurge(ua, ua->argv[j], &mr); + break; } done = true; } @@ -818,14 +817,14 @@ static int update_volume(UAContext *ua) case 16: pm_strcpy(ret, ""); - ua->info_msg(_("Current ActionOnPurge is: %s\n"), - aop_to_str(mr.ActionOnPurge, ret)); - if (!get_cmd(ua, _("Enter new ActionOnPurge (one of: Truncate, None): "))) { + ua->info_msg(_("Current ActionOnPurge is: %s\n"), + action_on_purge_to_string(mr.ActionOnPurge, ret)); + if (!get_cmd(ua, _("Enter new ActionOnPurge (one of: Truncate, None): "))) { return 0; - } + } update_vol_actiononpurge(ua, ua->cmd, &mr); - break; + break; default: /* Done or error */ ua->info_msg(_("Selection terminated.\n")); diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index 9de59dc296..6e024ea161 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -321,7 +321,7 @@ void jobstatus_to_ascii (int JobStatus, char *msg, int maxlen); void jobstatus_to_ascii_gui (int JobStatus, char *msg, int maxlen); int run_program (char *prog, int wait, POOLMEM *&results); int run_program_full_output (char *prog, int wait, POOLMEM *&results); -char * aop_to_str (int aop, POOL_MEM &ret); +char * action_on_purge_to_string(int aop, POOL_MEM &ret); const char * job_type_to_str (int type); const char * job_status_to_str (int stat); const char * job_level_to_str (int level); diff --git a/bacula/src/lib/util.c b/bacula/src/lib/util.c index 06f685806a..e7bb7aa496 100644 --- a/bacula/src/lib/util.c +++ b/bacula/src/lib/util.c @@ -397,9 +397,9 @@ const char *job_type_to_str(int type) /* Convert ActionOnPurge to string (Truncate, Erase, Destroy) */ -char *aop_to_str(int aop, POOL_MEM &ret) +char *action_on_purge_to_string(int aop, POOL_MEM &ret) { - if (aop & AOP_TRUNCATE) { + if (aop & ON_PURGE_TRUNCATE) { pm_strcpy(ret, _("Truncate")); } if (!aop) { -- 2.39.5