@@ -209,7 +209,7 @@ static int run_prepost_scripts(struct imglist *list, script_fn type)
return 0;
}
-int install_single_image(struct img_type *img, int dry_run)
+int install_single_image(struct img_type *img, bool dry_run)
{
struct installer_handler *hnd;
int ret;
@@ -255,7 +255,7 @@ int install_images(struct swupdate_cfg *sw)
char *filename;
struct stat buf;
const char* TMPDIR = get_tmpdir();
- int dry_run = sw->globals.dry_run;
+ bool dry_run = sw->globals.dry_run;
bool dropimg;
/* Extract all scripts, preinstall scripts must be run now */
@@ -525,10 +525,10 @@ void *network_initializer(void *data)
*/
switch (req->dry_run){
case RUN_DRYRUN:
- software->globals.dry_run = 1;
+ software->globals.dry_run = true;
break;
case RUN_INSTALL:
- software->globals.dry_run = 0;
+ software->globals.dry_run = false;
break;
case RUN_DEFAULT:
default:
@@ -629,7 +629,7 @@ int main(int argc, char **argv)
loglevel = strtoul(optarg, NULL, 10);
break;
case 'n':
- swcfg.globals.default_dry_run = 1;
+ swcfg.globals.default_dry_run = true;
break;
case 'L':
swcfg.globals.syslog_enabled = 1;
@@ -18,7 +18,7 @@ swupdate_file_t check_if_required(struct imglist *list, struct filehdr *pfdh,
const char *destdir,
struct img_type **pimg);
int install_images(struct swupdate_cfg *sw);
-int install_single_image(struct img_type *img, int dry_run);
+int install_single_image(struct img_type *img, bool dry_run);
int install_from_file(const char *filename, bool check);
int postupdate(struct swupdate_cfg *swcfg, const char *info);
int preupdatecmd(struct swupdate_cfg *swcfg);
@@ -127,7 +127,7 @@ struct swupdate_global_cfg {
char mtdblacklist[SWUPDATE_GENERAL_STRING_SIZE];
int loglevel;
int syslog_enabled;
- int dry_run;
+ bool dry_run;
int no_downgrading;
int no_reinstalling;
int no_transaction_marker;
@@ -139,7 +139,7 @@ struct swupdate_global_cfg {
char preupdatecmd[SWUPDATE_GENERAL_STRING_SIZE];
char default_software_set[SWUPDATE_GENERAL_STRING_SIZE];
char default_running_mode[SWUPDATE_GENERAL_STRING_SIZE];
- int default_dry_run;
+ bool default_dry_run;
char minimum_version[SWUPDATE_GENERAL_STRING_SIZE];
char maximum_version[SWUPDATE_GENERAL_STRING_SIZE];
char current_version[SWUPDATE_GENERAL_STRING_SIZE];
dry_run is used as boolean, switch from int type. Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/installer.c | 4 ++-- core/stream_interface.c | 4 ++-- core/swupdate.c | 2 +- include/installer.h | 2 +- include/swupdate.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-)