Skip to content
Permalink
Browse files
[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 99f2413d29a8c1ce7b9afaadba7b7f7ca1eadb50
Showing with 16 additions and 5 deletions.
  1. +4 −1 src/usb_moded-appsync.c
  2. +4 −1 src/usb_moded-appsync.h
  3. +6 −1 src/usb_moded-modesetting.c
  4. +2 −2 src/usb_moded.c
@@ -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
@@ -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 */
@@ -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
@@ -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);
@@ -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
@@ -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))
@@ -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 */
@@ -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

0 comments on commit 99f2413

Please sign in to comment.