Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[appsync] Change appsync_stop() to take boolean parameter
It is treated as a boolean, so using matching type improves readability.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Nov 7, 2016
1 parent 14092c6 commit 99f2413
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/usb_moded-appsync.c
Expand Up @@ -2,8 +2,11 @@
@file usb_moded-appsync.c
Copyright (C) 2010 Nokia Corporation. All rights reserved.
Copyright (C) 2013-2016 Jolla Ltd.
@author: Philippe De Swert <philippe.de-swert@nokia.com>
@author: Philippe De Swert <philippe.deswert@jollamobile.com>
@author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the Lesser GNU General Public License
Expand Down Expand Up @@ -449,7 +452,7 @@ static void appsync_stop_apps(int post)
}
}

int appsync_stop(int force)
int appsync_stop(gboolean force)
{
/* If force arg is used, stop all applications that
* could have been started by usb-moded */
Expand Down
5 changes: 4 additions & 1 deletion src/usb_moded-appsync.h
@@ -1,8 +1,11 @@
/*
Copyright (C) 2010 Nokia Corporation. All rights reserved.
Copyright (C) 2013-2016 Jolla Ltd.
author: Philippe De Swert <philippe.de-swert@nokia.com>
author: Philippe De Swert <philippe.deswert@jollamobile.com>
author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the Lesser GNU General Public License
Expand Down Expand Up @@ -57,6 +60,6 @@ void readlist(int diag);
int activate_sync(const char *mode);
int activate_sync_post(const char *mode);
int mark_active(const gchar *name, int post);
int appsync_stop(int force);
int appsync_stop(gboolean force);
void free_appsync_list(void);
void usb_moded_appsync_cleanup(void);
7 changes: 6 additions & 1 deletion src/usb_moded-modesetting.c
Expand Up @@ -2,8 +2,13 @@
@file usb_moded-modesetting.c
Copyright (C) 2010 Nokia Corporation. All rights reserved.
Copyright (C) 2013-2016 Jolla Ltd.
@author: Philippe De Swert <philippe.de-swert@nokia.com>
@author: Philippe De Swert <philippe.deswert@jollamobile.com>
@author: Bernd Wachter <bernd.wachter@jollamobile.com>
@author: Slava Monich <slava.monich@jolla.com>
@author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the Lesser GNU General Public License
Expand Down Expand Up @@ -567,7 +572,7 @@ int usb_moded_mode_cleanup(const char *module)

#ifdef APP_SYNC
/* Stop applications started due to entering this mode */
appsync_stop(0);
appsync_stop(FALSE);
#endif /* APP_SYNC */

if(!strcmp(module, MODULE_MASS_STORAGE)|| !strcmp(module, MODULE_FILE_STORAGE))
Expand Down
4 changes: 2 additions & 2 deletions src/usb_moded.c
Expand Up @@ -624,7 +624,7 @@ static void usb_moded_init(void)
#ifdef APP_SYNC
readlist(diag_mode);
/* make sure all services are down when starting */
appsync_stop(1);
appsync_stop(TRUE);
#endif /* APP_SYNC */

/* always read dyn modes even if appsync is not used */
Expand Down Expand Up @@ -673,7 +673,7 @@ static gboolean charging_fallback(gpointer data)
static void handle_exit(void)
{
/* exiting and clean-up when mainloop ended */
appsync_stop(1);
appsync_stop(TRUE);
hwal_cleanup();
usb_moded_dbus_cleanup();
#ifdef MEEGOLOCK
Expand Down

0 comments on commit 99f2413

Please sign in to comment.