anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0170-bus-message-drop-asserts-in-functions-which-are-wrap.patch

ff6046
From 03f2823251d39ea455c2e98ae8bf109f6caf153f Mon Sep 17 00:00:00 2001
ff6046
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
ff6046
Date: Fri, 3 Aug 2018 16:36:51 +0200
ff6046
Subject: [PATCH] bus-message: drop asserts in functions which are wrappers for
ff6046
 varargs version
ff6046
ff6046
The function does no processing on it's own, and just forwards arguments
ff6046
to the other function. Let's just use the asserts there.
ff6046
ff6046
(cherry picked from commit 8792bdf8a3311f9e629daa0ec592c97c1cfb2a7c)
ff6046
ff6046
Resolves: #1696224
ff6046
---
ff6046
 src/libsystemd/sd-bus/bus-message.c | 9 ---------
ff6046
 1 file changed, 9 deletions(-)
ff6046
ff6046
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
ff6046
index ac823aaf58..153cdf933b 100644
ff6046
--- a/src/libsystemd/sd-bus/bus-message.c
ff6046
+++ b/src/libsystemd/sd-bus/bus-message.c
ff6046
@@ -2469,11 +2469,6 @@ _public_ int sd_bus_message_append(sd_bus_message *m, const char *types, ...) {
ff6046
         va_list ap;
ff6046
         int r;
ff6046
 
ff6046
-        assert_return(m, -EINVAL);
ff6046
-        assert_return(types, -EINVAL);
ff6046
-        assert_return(!m->sealed, -EPERM);
ff6046
-        assert_return(!m->poisoned, -ESTALE);
ff6046
-
ff6046
         va_start(ap, types);
ff6046
         r = sd_bus_message_appendv(m, types, ap);
ff6046
         va_end(ap);
ff6046
@@ -4524,10 +4519,6 @@ _public_ int sd_bus_message_read(sd_bus_message *m, const char *types, ...) {
ff6046
         va_list ap;
ff6046
         int r;
ff6046
 
ff6046
-        assert_return(m, -EINVAL);
ff6046
-        assert_return(m->sealed, -EPERM);
ff6046
-        assert_return(types, -EINVAL);
ff6046
-
ff6046
         va_start(ap, types);
ff6046
         r = message_read_ap(m, types, ap);
ff6046
         va_end(ap);