From: Junghyun Yeon Date: Fri, 3 Feb 2017 07:06:18 +0000 (+0900) Subject: Change queue of cleardata X-Git-Tag: accepted/tizen/common/20170209.122548~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fappfw%2Fpkgmgr-server.git;a=commitdiff_plain;h=ffda75a93105b140c97e3c09c9a70e4dcaf5f653 Change queue of cleardata - Cleardata is performed by pkgmgr-server itself so change queue into pkgtool - reqkey is no longer required when calling cleardata so it was removed Change-Id: Iee3ece77bc22111c2bc590f5a4d4f1400792c3c8 Signed-off-by: Junghyun Yeon --- diff --git a/src/request.c b/src/request.c index 8e3793e..b3f9164 100644 --- a/src/request.c +++ b/src/request.c @@ -971,9 +971,7 @@ static int __handle_request_cleardata(uid_t caller_uid, GDBusMethodInvocation *invocation, GVariant *parameters) { uid_t target_uid = (uid_t)-1; - char *pkgtype; char *pkgid = NULL; - char *reqkey = NULL; g_variant_get(parameters, "(u&s)", &target_uid, &pkgid); if (target_uid == (uid_t)-1 || pkgid == NULL) { @@ -982,36 +980,16 @@ static int __handle_request_cleardata(uid_t caller_uid, return -1; } - pkgtype = _get_pkgtype_from_pkgid(pkgid, target_uid); - if (pkgtype == NULL) { - g_dbus_method_invocation_return_value(invocation, - g_variant_new("(i)", PKGMGR_R_ENOPKG)); - return -1; - } - - reqkey = __generate_reqkey(pkgid); - if (reqkey == NULL) { - g_dbus_method_invocation_return_value(invocation, - g_variant_new("(i)", PKGMGR_R_ENOMEM)); - free(pkgtype); - return -1; - } - - if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_CLEARDATA, - pkgtype, pkgid, NULL)) { + if (_push_queue(target_uid, caller_uid, NULL, REQUEST_TYPE_CLEARDATA, + "pkgtool", pkgid, NULL)) { g_dbus_method_invocation_return_value(invocation, g_variant_new("(i)", PKGMGR_R_ESYSTEM)); - free(reqkey); - free(pkgtype); return -1; } g_dbus_method_invocation_return_value(invocation, g_variant_new("(i)", PKGMGR_R_OK)); - free(reqkey); - free(pkgtype); - return 0; }