forked from intel/murphy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
systemd-204-src-rpm-shared-bus-lib-fedora-19.patch
1487 lines (1482 loc) · 51.7 KB
/
systemd-204-src-rpm-shared-bus-lib-fedora-19.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*** SPECS/systemd.spec.orig 2013-10-08 15:41:46.553548626 +0300
--- SPECS/systemd.spec 2013-10-08 16:42:09.438577231 +0300
***************
*** 78,83 ****
--- 78,87 ----
# kernel-install patch for grubby, drop if grubby is obsolete
Patch1000: kernel-install-grubby.patch
+ # patches to turn libsystemd-bus into a publicly available shared library
+ Patch10000: 0001-systemd-bus-create-a-shared-library-for-public-consu.patch
+ Patch10001: 0002-systemd-bus-add-linker-script-for-exporting-public-s.patch
+
%global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);}
BuildRequires: libcap-devel
***************
*** 179,184 ****
--- 183,204 ----
%description devel
Development headers and auxiliary files for developing applications for systemd.
+ %package libs-dbus
+ Summary: systemd D-Bus client library
+ License: LGPLV2+
+ Requires: systemd-libs = %{version}
+
+ %description libs-dbus
+ D-Bus library from the systemd sources.
+
+ %package libs-dbus-devel
+ Summary: Development headers for systemd-libs-dbus
+ License: LGPLv2+
+ Requires: systemd-devel = %{version}
+
+ %description libs-dbus-devel
+ Development files for the D-Bus library from the systemd sources.
+
%package sysv
Summary: SysV tools for systemd
License: LGPLv2+
***************
*** 813,818 ****
--- 833,849 ----
%dir %{_datadir}/gtk-doc/html/libudev
%{_datadir}/gtk-doc/html/libudev/*
+ %files libs-dbus
+ %{_libdir}/libsystemd-bus.so.0.0.0
+ %{_libdir}/libsystemd-bus.so.0
+
+ %files libs-dbus-devel
+ %{_includedir}/systemd/sd-bus.h
+ %{_includedir}/systemd/sd-bus-protocol.h
+ %{_includedir}/systemd/bus
+ %{_libdir}/libsystemd-bus.so
+ %{_libdir}/pkgconfig/libsystemd-bus.pc
+
%files sysv
%{_bindir}/systemd-sysv-convert
*** /dev/null 2013-10-07 20:46:19.236668618 +0300
--- SOURCES/0001-systemd-bus-create-a-shared-library-for-public-consu.patch 2013-10-08 16:42:36.058540733 +0300
***************
*** 0 ****
--- 1,1235 ----
+ From bdc2ebcf236cf83a8e3f94d438f6c2c63f9379df Mon Sep 17 00:00:00 2001
+ From: Fedora systemd team <[email protected]>
+ Date: Tue, 8 Oct 2013 15:00:16 +0300
+ Subject: [PATCH 1/2] systemd-bus: create a shared library for public
+ consumption.
+
+ For testing systemd-bus as a libdbus replacement, create a shared
+ library out of it. Note that as a quick fix the symbols referenced
+ by the various test-* unit tests have been marked public and
+ exported from the library along with the public API. This is just
+ a temporary workaround to get us going and we need something more
+ civilized instead.
+ ---
+ Makefile.am | 28 +++++++-
+ src/libsystemd-bus/bus-control.c | 14 ++--
+ src/libsystemd-bus/bus-error.c | 15 +++--
+ src/libsystemd-bus/bus-internal.c | 15 +++--
+ src/libsystemd-bus/bus-kernel.c | 2 +-
+ src/libsystemd-bus/bus-match.c | 21 ++++--
+ src/libsystemd-bus/bus-message.c | 114 +++++++++++++++++---------------
+ src/libsystemd-bus/bus-signature.c | 9 ++-
+ src/libsystemd-bus/libsystemd-bus.pc.in | 19 ++++++
+ src/libsystemd-bus/sd-bus.c | 78 +++++++++++-----------
+ 10 files changed, 190 insertions(+), 125 deletions(-)
+ create mode 100644 src/libsystemd-bus/libsystemd-bus.pc.in
+
+ diff --git a/Makefile.am b/Makefile.am
+ index 3a196a6..96e6068 100644
+ --- a/Makefile.am
+ +++ b/Makefile.am
+ @@ -55,6 +55,10 @@ LIBSYSTEMD_JOURNAL_CURRENT=10
+ LIBSYSTEMD_JOURNAL_REVISION=2
+ LIBSYSTEMD_JOURNAL_AGE=10
+
+ +LIBSYSTEMD_BUS_CURRENT=0
+ +LIBSYSTEMD_BUS_REVISION=0
+ +LIBSYSTEMD_BUS_AGE=0
+ +
+ # Dirs of external packages
+ dbuspolicydir=@dbuspolicydir@
+ dbussessionservicedir=@dbussessionservicedir@
+ @@ -1746,7 +1750,29 @@ libsystemd_bus_la_LIBADD = \
+ libsystemd-shared.la \
+ libsystemd-daemon.la
+
+ -noinst_LTLIBRARIES += \
+ +libsystemd_bus_la_LDFLAGS = \
+ + $(AM_LDFLAGS) \
+ + -version-info $(LIBSYSTEMD_BUS_CURRENT):$(LIBSYSTEMD_BUS_REVISION):$(LIBSYSTEMD_BUS_AGE) \
+ + -Wl,--version-script=$(top_srcdir)/src/libsystemd-bus/libsystemd-bus.sym
+ +
+ +pkginclude_HEADERS += \
+ + src/systemd/sd-bus.h \
+ + src/systemd/sd-bus-protocol.h
+ +
+ +libsystemd_bus_la_HEADERS = \
+ + src/libsystemd-bus/bus-message.h \
+ + src/libsystemd-bus/kdbus.h \
+ + src/shared/macro.h \
+ + src/shared/log.h \
+ + src/shared/time-util.h
+ +
+ +libsystemd_bus_ladir = \
+ + $(includedir)/systemd/bus
+ +
+ +pkgconfiglib_DATA += \
+ + src/libsystemd-bus/libsystemd-bus.pc
+ +
+ +lib_LTLIBRARIES += \
+ libsystemd-bus.la
+
+ tests += \
+ diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c
+ index a4dc9bf..b7ba3bb 100644
+ --- a/src/libsystemd-bus/bus-control.c
+ +++ b/src/libsystemd-bus/bus-control.c
+ @@ -33,7 +33,7 @@
+ #include "bus-message.h"
+ #include "bus-control.h"
+
+ -int sd_bus_get_unique_name(sd_bus *bus, const char **unique) {
+ +_public_ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) {
+ int r;
+
+ if (!bus)
+ @@ -49,7 +49,7 @@ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) {
+ return 0;
+ }
+
+ -int sd_bus_request_name(sd_bus *bus, const char *name, int flags) {
+ +_public_ int sd_bus_request_name(sd_bus *bus, const char *name, int flags) {
+ _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+ uint32_t ret;
+ int r;
+ @@ -103,7 +103,7 @@ int sd_bus_request_name(sd_bus *bus, const char *name, int flags) {
+ }
+ }
+
+ -int sd_bus_release_name(sd_bus *bus, const char *name) {
+ +_public_ int sd_bus_release_name(sd_bus *bus, const char *name) {
+ _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+ uint32_t ret;
+ int r;
+ @@ -154,7 +154,7 @@ int sd_bus_release_name(sd_bus *bus, const char *name) {
+ return ret;
+ }
+
+ -int sd_bus_list_names(sd_bus *bus, char ***l) {
+ +_public_ int sd_bus_list_names(sd_bus *bus, char ***l) {
+ _cleanup_bus_message_unref_ sd_bus_message *reply1 = NULL, *reply2 = NULL;
+ char **x = NULL;
+ int r;
+ @@ -204,7 +204,7 @@ int sd_bus_list_names(sd_bus *bus, char ***l) {
+ return 0;
+ }
+
+ -int sd_bus_get_owner(sd_bus *bus, const char *name, char **owner) {
+ +_public_ int sd_bus_get_owner(sd_bus *bus, const char *name, char **owner) {
+ _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+ const char *found;
+ int r;
+ @@ -244,7 +244,7 @@ int sd_bus_get_owner(sd_bus *bus, const char *name, char **owner) {
+ return 0;
+ }
+
+ -int sd_bus_get_owner_uid(sd_bus *bus, const char *name, uid_t *uid) {
+ +_public_ int sd_bus_get_owner_uid(sd_bus *bus, const char *name, uid_t *uid) {
+ _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+ uint32_t u;
+ int r;
+ @@ -277,7 +277,7 @@ int sd_bus_get_owner_uid(sd_bus *bus, const char *name, uid_t *uid) {
+ return 0;
+ }
+
+ -int sd_bus_get_owner_pid(sd_bus *bus, const char *name, pid_t *pid) {
+ +_public_ int sd_bus_get_owner_pid(sd_bus *bus, const char *name, pid_t *pid) {
+ _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+ uint32_t u;
+ int r;
+ diff --git a/src/libsystemd-bus/bus-error.c b/src/libsystemd-bus/bus-error.c
+ index 5faa173..145a378 100644
+ --- a/src/libsystemd-bus/bus-error.c
+ +++ b/src/libsystemd-bus/bus-error.c
+ @@ -38,7 +38,7 @@ bool bus_error_is_dirty(sd_bus_error *e) {
+ return e->name || e->message || e->need_free;
+ }
+
+ -void sd_bus_error_free(sd_bus_error *e) {
+ +_public_ void sd_bus_error_free(sd_bus_error *e) {
+ if (!e)
+ return;
+
+ @@ -51,7 +51,7 @@ void sd_bus_error_free(sd_bus_error *e) {
+ e->need_free = false;
+ }
+
+ -int sd_bus_error_set(sd_bus_error *e, const char *name, const char *format, ...) {
+ +_public_ int sd_bus_error_set(sd_bus_error *e, const char *name, const char *format, ...) {
+ char *n, *m = NULL;
+ va_list ap;
+ int r;
+ @@ -85,7 +85,7 @@ int sd_bus_error_set(sd_bus_error *e, const char *name, const char *format, ...)
+ return 0;
+ }
+
+ -int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e) {
+ +_public_ int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e) {
+ char *x, *y = NULL;
+
+ if (!dest)
+ @@ -113,7 +113,7 @@ int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e) {
+ return 0;
+ }
+
+ -void sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *message) {
+ +_public_ void sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *message) {
+ if (!e)
+ return;
+ if (bus_error_is_dirty(e))
+ @@ -124,14 +124,14 @@ void sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *messa
+ e->need_free = false;
+ }
+
+ -int sd_bus_error_is_set(const sd_bus_error *e) {
+ +_public_ int sd_bus_error_is_set(const sd_bus_error *e) {
+ if (!e)
+ return 0;
+
+ return !!e->name;
+ }
+
+ -int sd_bus_error_has_name(const sd_bus_error *e, const char *name) {
+ +_public_ int sd_bus_error_has_name(const sd_bus_error *e, const char *name) {
+ if (!e)
+ return 0;
+
+ @@ -169,7 +169,8 @@ int bus_error_from_errno(sd_bus_error *e, int error) {
+ return error;
+ }
+
+ -const char *bus_error_message(const sd_bus_error *e, int error) {
+ +/* XXX TODO: for test-* */
+ +_public_ const char *bus_error_message(const sd_bus_error *e, int error) {
+ if (e && e->message)
+ return e->message;
+
+ diff --git a/src/libsystemd-bus/bus-internal.c b/src/libsystemd-bus/bus-internal.c
+ index 0e66f3d..f2a9eaa 100644
+ --- a/src/libsystemd-bus/bus-internal.c
+ +++ b/src/libsystemd-bus/bus-internal.c
+ @@ -101,7 +101,8 @@ bool interface_name_is_valid(const char *p) {
+ return true;
+ }
+
+ -bool service_name_is_valid(const char *p) {
+ +/* XXX TODO: for busctl */
+ +_public_ bool service_name_is_valid(const char *p) {
+ const char *q;
+ bool dot, found_dot, unique;
+
+ @@ -192,11 +193,13 @@ static bool complex_pattern_check(char c, const char *a, const char *b) {
+ }
+ }
+
+ -bool namespace_complex_pattern(const char *pattern, const char *value) {
+ +/* XXX TODO: for test-* */
+ +_public_ bool namespace_complex_pattern(const char *pattern, const char *value) {
+ return complex_pattern_check('.', pattern, value);
+ }
+
+ -bool path_complex_pattern(const char *pattern, const char *value) {
+ +/* XXX TODO: for test-* */
+ +_public_ bool path_complex_pattern(const char *pattern, const char *value) {
+ return complex_pattern_check('/', pattern, value);
+ }
+
+ @@ -219,11 +222,13 @@ static bool simple_pattern_check(char c, const char *a, const char *b) {
+ }
+ }
+
+ -bool namespace_simple_pattern(const char *pattern, const char *value) {
+ +/* XXX TODO: for test-* */
+ +_public_ bool namespace_simple_pattern(const char *pattern, const char *value) {
+ return simple_pattern_check('.', pattern, value);
+ }
+
+ -bool path_simple_pattern(const char *pattern, const char *value) {
+ +/* XXX TODO: for test-* */
+ +_public_ bool path_simple_pattern(const char *pattern, const char *value) {
+ return simple_pattern_check('/', pattern, value);
+ }
+
+ diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
+ index 0762b78..d9f96ea 100644
+ --- a/src/libsystemd-bus/bus-kernel.c
+ +++ b/src/libsystemd-bus/bus-kernel.c
+ @@ -566,7 +566,7 @@ int bus_kernel_read_message(sd_bus *bus, sd_bus_message **m) {
+ return r < 0 ? r : 1;
+ }
+
+ -int bus_kernel_create(const char *name, char **s) {
+ +_public_ int bus_kernel_create(const char *name, char **s) {
+ struct kdbus_cmd_bus_make *make;
+ struct kdbus_item *n, *cg;
+ size_t l;
+ diff --git a/src/libsystemd-bus/bus-match.c b/src/libsystemd-bus/bus-match.c
+ index 501a38d..5e0b7b6 100644
+ --- a/src/libsystemd-bus/bus-match.c
+ +++ b/src/libsystemd-bus/bus-match.c
+ @@ -196,7 +196,8 @@ static bool value_node_same(
+ }
+ }
+
+ -int bus_match_run(
+ +/* XXX TODO: for test-* */
+ +_public_ int bus_match_run(
+ sd_bus *bus,
+ struct bus_match_node *node,
+ int ret,
+ @@ -550,7 +551,8 @@ static int bus_match_find_leaf(
+ return 0;
+ }
+
+ -enum bus_match_node_type bus_match_node_type_from_string(const char *k, size_t n) {
+ +/* XXX TODO: for test-* */
+ +_public_ enum bus_match_node_type bus_match_node_type_from_string(const char *k, size_t n) {
+ assert(k);
+
+ if (n == 4 && memcmp(k, "type", 4) == 0)
+ @@ -791,7 +793,8 @@ fail:
+ return r;
+ }
+
+ -int bus_match_add(
+ +/* XXX TODO: for test-* */
+ +_public_ int bus_match_add(
+ struct bus_match_node *root,
+ const char *match,
+ sd_bus_message_handler_t callback,
+ @@ -832,7 +835,8 @@ finish:
+ return r;
+ }
+
+ -int bus_match_remove(
+ +/* XXX TODO: for test-* */
+ +_public_ int bus_match_remove(
+ struct bus_match_node *root,
+ const char *match,
+ sd_bus_message_handler_t callback,
+ @@ -887,7 +891,8 @@ finish:
+ return r;
+ }
+
+ -void bus_match_free(struct bus_match_node *node) {
+ +/* XXX TODO: for test-* */
+ +_public_ void bus_match_free(struct bus_match_node *node) {
+ struct bus_match_node *c;
+
+ if (!node)
+ @@ -909,7 +914,8 @@ void bus_match_free(struct bus_match_node *node) {
+ bus_match_node_free(node);
+ }
+
+ -const char* bus_match_node_type_to_string(enum bus_match_node_type t, char buf[], size_t l) {
+ +/* XXX TODO: for test-* */
+ +_public_ const char* bus_match_node_type_to_string(enum bus_match_node_type t, char buf[], size_t l) {
+ switch (t) {
+
+ case BUS_MATCH_ROOT:
+ @@ -959,7 +965,8 @@ const char* bus_match_node_type_to_string(enum bus_match_node_type t, char buf[]
+ }
+ }
+
+ -void bus_match_dump(struct bus_match_node *node, unsigned level) {
+ +/* XXX TODO: for test-* */
+ +_public_ void bus_match_dump(struct bus_match_node *node, unsigned level) {
+ struct bus_match_node *c;
+ _cleanup_free_ char *pfx = NULL;
+ char buf[32];
+ diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
+ index 835a9f9..8c99143 100644
+ --- a/src/libsystemd-bus/bus-message.c
+ +++ b/src/libsystemd-bus/bus-message.c
+ @@ -303,7 +303,8 @@ int bus_message_from_header(
+ return 0;
+ }
+
+ -int bus_message_from_malloc(
+ +/* XXX TODO: for test-* */
+ +_public_ int bus_message_from_malloc(
+ void *buffer,
+ size_t length,
+ int *fds,
+ @@ -364,7 +365,7 @@ static sd_bus_message *message_new(sd_bus *bus, uint8_t type) {
+ return m;
+ }
+
+ -int sd_bus_message_new_signal(
+ +_public_ int sd_bus_message_new_signal(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ @@ -409,7 +410,7 @@ fail:
+ return r;
+ }
+
+ -int sd_bus_message_new_method_call(
+ +_public_ int sd_bus_message_new_method_call(
+ sd_bus *bus,
+ const char *destination,
+ const char *path,
+ @@ -507,7 +508,7 @@ fail:
+ return r;
+ }
+
+ -int sd_bus_message_new_method_return(
+ +_public_ int sd_bus_message_new_method_return(
+ sd_bus *bus,
+ sd_bus_message *call,
+ sd_bus_message **m) {
+ @@ -515,7 +516,7 @@ int sd_bus_message_new_method_return(
+ return message_new_reply(bus, call, SD_BUS_MESSAGE_TYPE_METHOD_RETURN, m);
+ }
+
+ -int sd_bus_message_new_method_error(
+ +_public_ int sd_bus_message_new_method_error(
+ sd_bus *bus,
+ sd_bus_message *call,
+ const sd_bus_error *e,
+ @@ -551,7 +552,7 @@ fail:
+ return r;
+ }
+
+ -sd_bus_message* sd_bus_message_ref(sd_bus_message *m) {
+ +_public_ sd_bus_message* sd_bus_message_ref(sd_bus_message *m) {
+ if (!m)
+ return NULL;
+
+ @@ -561,7 +562,7 @@ sd_bus_message* sd_bus_message_ref(sd_bus_message *m) {
+ return m;
+ }
+
+ -sd_bus_message* sd_bus_message_unref(sd_bus_message *m) {
+ +_public_ sd_bus_message* sd_bus_message_unref(sd_bus_message *m) {
+ if (!m)
+ return NULL;
+
+ @@ -574,7 +575,7 @@ sd_bus_message* sd_bus_message_unref(sd_bus_message *m) {
+ return NULL;
+ }
+
+ -int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type) {
+ +_public_ int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type) {
+ if (!m)
+ return -EINVAL;
+ if (!type)
+ @@ -584,7 +585,7 @@ int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_serial(sd_bus_message *m, uint64_t *serial) {
+ +_public_ int sd_bus_message_get_serial(sd_bus_message *m, uint64_t *serial) {
+ if (!m)
+ return -EINVAL;
+ if (!serial)
+ @@ -596,7 +597,7 @@ int sd_bus_message_get_serial(sd_bus_message *m, uint64_t *serial) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_reply_serial(sd_bus_message *m, uint64_t *serial) {
+ +_public_ int sd_bus_message_get_reply_serial(sd_bus_message *m, uint64_t *serial) {
+ if (!m)
+ return -EINVAL;
+ if (!serial)
+ @@ -608,48 +609,48 @@ int sd_bus_message_get_reply_serial(sd_bus_message *m, uint64_t *serial) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_no_reply(sd_bus_message *m) {
+ +_public_ int sd_bus_message_get_no_reply(sd_bus_message *m) {
+ if (!m)
+ return -EINVAL;
+
+ return m->header->type == SD_BUS_MESSAGE_TYPE_METHOD_CALL ? !!(m->header->flags & SD_BUS_MESSAGE_NO_REPLY_EXPECTED) : 0;
+ }
+
+ -const char *sd_bus_message_get_path(sd_bus_message *m) {
+ +_public_ const char *sd_bus_message_get_path(sd_bus_message *m) {
+ if (!m)
+ return NULL;
+
+ return m->path;
+ }
+
+ -const char *sd_bus_message_get_interface(sd_bus_message *m) {
+ +_public_ const char *sd_bus_message_get_interface(sd_bus_message *m) {
+ if (!m)
+ return NULL;
+
+ return m->interface;
+ }
+
+ -const char *sd_bus_message_get_member(sd_bus_message *m) {
+ +_public_ const char *sd_bus_message_get_member(sd_bus_message *m) {
+ if (!m)
+ return NULL;
+
+ return m->member;
+ }
+ -const char *sd_bus_message_get_destination(sd_bus_message *m) {
+ +_public_ const char *sd_bus_message_get_destination(sd_bus_message *m) {
+ if (!m)
+ return NULL;
+
+ return m->destination;
+ }
+
+ -const char *sd_bus_message_get_sender(sd_bus_message *m) {
+ +_public_ const char *sd_bus_message_get_sender(sd_bus_message *m) {
+ if (!m)
+ return NULL;
+
+ return m->sender;
+ }
+
+ -const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m) {
+ +_public_ const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m) {
+ if (!m)
+ return NULL;
+
+ @@ -659,7 +660,7 @@ const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m) {
+ return &m->error;
+ }
+
+ -int sd_bus_message_get_uid(sd_bus_message *m, uid_t *uid) {
+ +_public_ int sd_bus_message_get_uid(sd_bus_message *m, uid_t *uid) {
+ if (!m)
+ return -EINVAL;
+ if (!uid)
+ @@ -671,7 +672,7 @@ int sd_bus_message_get_uid(sd_bus_message *m, uid_t *uid) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_gid(sd_bus_message *m, gid_t *gid) {
+ +_public_ int sd_bus_message_get_gid(sd_bus_message *m, gid_t *gid) {
+ if (!m)
+ return -EINVAL;
+ if (!gid)
+ @@ -683,7 +684,7 @@ int sd_bus_message_get_gid(sd_bus_message *m, gid_t *gid) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_pid(sd_bus_message *m, pid_t *pid) {
+ +_public_ int sd_bus_message_get_pid(sd_bus_message *m, pid_t *pid) {
+ if (!m)
+ return -EINVAL;
+ if (!pid)
+ @@ -695,7 +696,7 @@ int sd_bus_message_get_pid(sd_bus_message *m, pid_t *pid) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_tid(sd_bus_message *m, pid_t *tid) {
+ +_public_ int sd_bus_message_get_tid(sd_bus_message *m, pid_t *tid) {
+ if (!m)
+ return -EINVAL;
+ if (!tid)
+ @@ -707,7 +708,7 @@ int sd_bus_message_get_tid(sd_bus_message *m, pid_t *tid) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec) {
+ +_public_ int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec) {
+ if (!m)
+ return -EINVAL;
+ if (!usec)
+ @@ -719,7 +720,7 @@ int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_selinux_context(sd_bus_message *m, const char **ret) {
+ +_public_ int sd_bus_message_get_selinux_context(sd_bus_message *m, const char **ret) {
+ if (!m)
+ return -EINVAL;
+ if (!m->label)
+ @@ -729,7 +730,7 @@ int sd_bus_message_get_selinux_context(sd_bus_message *m, const char **ret) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_monotonic_timestamp(sd_bus_message *m, uint64_t *usec) {
+ +_public_ int sd_bus_message_get_monotonic_timestamp(sd_bus_message *m, uint64_t *usec) {
+ if (!m)
+ return -EINVAL;
+ if (!usec)
+ @@ -741,7 +742,7 @@ int sd_bus_message_get_monotonic_timestamp(sd_bus_message *m, uint64_t *usec) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *usec) {
+ +_public_ int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *usec) {
+ if (!m)
+ return -EINVAL;
+ if (!usec)
+ @@ -753,7 +754,7 @@ int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *usec) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_comm(sd_bus_message *m, const char **ret) {
+ +_public_ int sd_bus_message_get_comm(sd_bus_message *m, const char **ret) {
+ if (!m)
+ return -EINVAL;
+ if (!ret)
+ @@ -765,7 +766,7 @@ int sd_bus_message_get_comm(sd_bus_message *m, const char **ret) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_tid_comm(sd_bus_message *m, const char **ret) {
+ +_public_ int sd_bus_message_get_tid_comm(sd_bus_message *m, const char **ret) {
+ if (!m)
+ return -EINVAL;
+ if (!ret)
+ @@ -777,7 +778,7 @@ int sd_bus_message_get_tid_comm(sd_bus_message *m, const char **ret) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_exe(sd_bus_message *m, const char **ret) {
+ +_public_ int sd_bus_message_get_exe(sd_bus_message *m, const char **ret) {
+ if (!m)
+ return -EINVAL;
+ if (!ret)
+ @@ -789,7 +790,7 @@ int sd_bus_message_get_exe(sd_bus_message *m, const char **ret) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_cgroup(sd_bus_message *m, const char **ret) {
+ +_public_ int sd_bus_message_get_cgroup(sd_bus_message *m, const char **ret) {
+ if (!m)
+ return -EINVAL;
+ if (!ret)
+ @@ -801,7 +802,7 @@ int sd_bus_message_get_cgroup(sd_bus_message *m, const char **ret) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_unit(sd_bus_message *m, const char **ret) {
+ +_public_ int sd_bus_message_get_unit(sd_bus_message *m, const char **ret) {
+ int r;
+
+ if (!m)
+ @@ -821,7 +822,7 @@ int sd_bus_message_get_unit(sd_bus_message *m, const char **ret) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_user_unit(sd_bus_message *m, const char **ret) {
+ +_public_ int sd_bus_message_get_user_unit(sd_bus_message *m, const char **ret) {
+ int r;
+
+ if (!m)
+ @@ -841,7 +842,7 @@ int sd_bus_message_get_user_unit(sd_bus_message *m, const char **ret) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_session(sd_bus_message *m, const char **ret) {
+ +_public_ int sd_bus_message_get_session(sd_bus_message *m, const char **ret) {
+ int r;
+
+ if (!m)
+ @@ -861,7 +862,7 @@ int sd_bus_message_get_session(sd_bus_message *m, const char **ret) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_owner_uid(sd_bus_message *m, uid_t *uid) {
+ +_public_ int sd_bus_message_get_owner_uid(sd_bus_message *m, uid_t *uid) {
+ if (!m)
+ return -EINVAL;
+ if (!uid)
+ @@ -872,7 +873,7 @@ int sd_bus_message_get_owner_uid(sd_bus_message *m, uid_t *uid) {
+ return cg_path_get_owner_uid(m->cgroup, uid);
+ }
+
+ -int sd_bus_message_get_cmdline(sd_bus_message *m, char ***cmdline) {
+ +_public_ int sd_bus_message_get_cmdline(sd_bus_message *m, char ***cmdline) {
+ size_t n, i;
+ const char *p;
+ bool first;
+ @@ -904,7 +905,7 @@ int sd_bus_message_get_cmdline(sd_bus_message *m, char ***cmdline) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_audit_sessionid(sd_bus_message *m, uint32_t *sessionid) {
+ +_public_ int sd_bus_message_get_audit_sessionid(sd_bus_message *m, uint32_t *sessionid) {
+ if (!m)
+ return -EINVAL;
+ if (!sessionid)
+ @@ -916,7 +917,7 @@ int sd_bus_message_get_audit_sessionid(sd_bus_message *m, uint32_t *sessionid) {
+ return 0;
+ }
+
+ -int sd_bus_message_get_audit_loginuid(sd_bus_message *m, uid_t *uid) {
+ +_public_ int sd_bus_message_get_audit_loginuid(sd_bus_message *m, uid_t *uid) {
+ if (!m)
+ return -EINVAL;
+ if (!uid)
+ @@ -928,7 +929,7 @@ int sd_bus_message_get_audit_loginuid(sd_bus_message *m, uid_t *uid) {
+ return 0;
+ }
+
+ -int sd_bus_message_has_effective_cap(sd_bus_message *m, int capability) {
+ +_public_ int sd_bus_message_has_effective_cap(sd_bus_message *m, int capability) {
+ unsigned sz;
+
+ if (!m)
+ @@ -945,7 +946,7 @@ int sd_bus_message_has_effective_cap(sd_bus_message *m, int capability) {
+ return !!(m->capability[2 * sz + (capability / 8)] & (1 << (capability % 8)));
+ }
+
+ -int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const char *member) {
+ +_public_ int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const char *member) {
+ if (!m)
+ return -EINVAL;
+
+ @@ -961,7 +962,7 @@ int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const cha
+ return 1;
+ }
+
+ -int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, const char *member) {
+ +_public_ int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, const char *member) {
+ if (!m)
+ return -EINVAL;
+
+ @@ -977,7 +978,7 @@ int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, cons
+ return 1;
+ }
+
+ -int sd_bus_message_is_method_error(sd_bus_message *m, const char *name) {
+ +_public_ int sd_bus_message_is_method_error(sd_bus_message *m, const char *name) {
+ if (!m)
+ return -EINVAL;
+
+ @@ -990,7 +991,7 @@ int sd_bus_message_is_method_error(sd_bus_message *m, const char *name) {
+ return 1;
+ }
+
+ -int sd_bus_message_set_no_reply(sd_bus_message *m, int b) {
+ +_public_ int sd_bus_message_set_no_reply(sd_bus_message *m, int b) {
+ if (!m)
+ return -EINVAL;
+ if (m->sealed)
+ @@ -1203,7 +1204,7 @@ fail:
+ return r;
+ }
+
+ -int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p) {
+ +_public_ int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p) {
+ return message_append_basic(m, type, p, NULL);
+ }
+
+ @@ -1430,7 +1431,7 @@ static int bus_message_open_dict_entry(
+ return 0;
+ }
+
+ -int sd_bus_message_open_container(
+ +_public_ int sd_bus_message_open_container(
+ sd_bus_message *m,
+ char type,
+ const char *contents) {
+ @@ -1486,7 +1487,7 @@ int sd_bus_message_open_container(
+ return 0;
+ }
+
+ -int sd_bus_message_close_container(sd_bus_message *m) {
+ +_public_ int sd_bus_message_close_container(sd_bus_message *m) {
+ struct bus_container *c;
+
+ if (!m)
+ @@ -1744,7 +1745,7 @@ int bus_message_append_ap(
+ return 0;
+ }
+
+ -int sd_bus_message_append(sd_bus_message *m, const char *types, ...) {
+ +_public_ int sd_bus_message_append(sd_bus_message *m, const char *types, ...) {
+ va_list ap;
+ int r;
+
+ @@ -1858,7 +1859,7 @@ static bool validate_object_path(const char *s, size_t l) {
+ return true;
+ }
+
+ -int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) {
+ +_public_ int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) {
+ struct bus_container *c;
+ int r;
+ void *q;
+ @@ -2182,7 +2183,7 @@ static int bus_message_enter_dict_entry(
+ return 1;
+ }
+
+ -int sd_bus_message_enter_container(sd_bus_message *m, char type, const char *contents) {
+ +_public_ int sd_bus_message_enter_container(sd_bus_message *m, char type, const char *contents) {
+ struct bus_container *c, *w;
+ uint32_t *array_size = NULL;
+ char *signature;
+ @@ -2255,7 +2256,7 @@ int sd_bus_message_enter_container(sd_bus_message *m, char type, const char *con
+ return 1;
+ }
+
+ -int sd_bus_message_exit_container(sd_bus_message *m) {
+ +_public_ int sd_bus_message_exit_container(sd_bus_message *m) {
+ struct bus_container *c;
+
+ if (!m)
+ @@ -2284,7 +2285,7 @@ int sd_bus_message_exit_container(sd_bus_message *m) {
+ return 1;
+ }
+
+ -int sd_bus_message_peek_type(sd_bus_message *m, char *type, const char **contents) {
+ +_public_ int sd_bus_message_peek_type(sd_bus_message *m, char *type, const char **contents) {
+ struct bus_container *c;
+ int r;
+
+ @@ -2406,7 +2407,7 @@ eof:
+ return 0;
+ }
+
+ -int sd_bus_message_rewind(sd_bus_message *m, int complete) {
+ +_public_ int sd_bus_message_rewind(sd_bus_message *m, int complete) {
+ struct bus_container *c;
+
+ if (!m)
+ @@ -2609,7 +2610,7 @@ static int message_read_ap(
+ return 1;
+ }
+
+ -int sd_bus_message_read(sd_bus_message *m, const char *types, ...) {
+ +_public_ int sd_bus_message_read(sd_bus_message *m, const char *types, ...) {
+ va_list ap;
+ int r;
+
+ @@ -3060,7 +3061,8 @@ int bus_message_parse_fields(sd_bus_message *m) {
+ return 0;
+ }
+
+ -int bus_message_seal(sd_bus_message *m, uint64_t serial) {
+ +/* XXX TODO: for test-* */
+ +_public_ int bus_message_seal(sd_bus_message *m, uint64_t serial) {
+ int r;
+ size_t l, a;
+
+ @@ -3107,7 +3109,7 @@ int bus_message_seal(sd_bus_message *m, uint64_t serial) {
+ return 0;
+ }
+
+ -int sd_bus_message_set_destination(sd_bus_message *m, const char *destination) {
+ +_public_ int sd_bus_message_set_destination(sd_bus_message *m, const char *destination) {
+ if (!m)
+ return -EINVAL;
+ if (!destination)
+ @@ -3120,7 +3122,8 @@ int sd_bus_message_set_destination(sd_bus_message *m, const char *destination) {
+ return message_append_field_string(m, SD_BUS_MESSAGE_HEADER_DESTINATION, SD_BUS_TYPE_STRING, destination, &m->destination);
+ }
+
+ -int bus_message_dump(sd_bus_message *m) {
+ +/* XXX TODO: for test-* */
+ +_public_ int bus_message_dump(sd_bus_message *m) {
+ const char *u = NULL, *uu = NULL, *s = NULL;
+ char **cmdline = NULL;
+ unsigned level = 1;
+ @@ -3378,7 +3381,8 @@ int bus_message_dump(sd_bus_message *m) {
+ return 0;
+ }
+
+ -int bus_message_get_blob(sd_bus_message *m, void **buffer, size_t *sz) {
+ +/* XXX TODO: for test-* */
+ +_public_ int bus_message_get_blob(sd_bus_message *m, void **buffer, size_t *sz) {
+ size_t total;
+ void *p, *e;
+
+ diff --git a/src/libsystemd-bus/bus-signature.c b/src/libsystemd-bus/bus-signature.c
+ index a92b712..3755d08 100644
+ --- a/src/libsystemd-bus/bus-signature.c
+ +++ b/src/libsystemd-bus/bus-signature.c
+ @@ -110,7 +110,8 @@ int signature_element_length(const char *s, size_t *l) {
+ return signature_element_length_internal(s, true, 0, 0, l);
+ }
+
+ -bool signature_is_single(const char *s) {
+ +/* XXX TODO: for test-* */
+ +_public_ bool signature_is_single(const char *s) {
+ int r;
+ size_t t;
+
+ @@ -123,7 +124,8 @@ bool signature_is_single(const char *s) {
+ return s[t] == 0;
+ }
+
+ -bool signature_is_pair(const char *s) {
+ +/* XXX TODO: for test-* */
+ +_public_ bool signature_is_pair(const char *s) {
+ assert(s);
+
+ if (!bus_type_is_basic(*s))
+ @@ -132,7 +134,8 @@ bool signature_is_pair(const char *s) {
+ return signature_is_single(s + 1);
+ }
+
+ -bool signature_is_valid(const char *s, bool allow_dict_entry) {
+ +/* XXX TODO: for test-* */
+ +_public_ bool signature_is_valid(const char *s, bool allow_dict_entry) {
+ const char *p;
+ int r;
+
+ diff --git a/src/libsystemd-bus/libsystemd-bus.pc.in b/src/libsystemd-bus/libsystemd-bus.pc.in
+ new file mode 100644
+ index 0000000..6907a1d
+ --- /dev/null
+ +++ b/src/libsystemd-bus/libsystemd-bus.pc.in
+ @@ -0,0 +1,19 @@
+ +# This file is part of systemd.
+ +#
+ +# systemd is free software; you can redistribute it and/or modify it
+ +# under the terms of the GNU Lesser General Public License as published by
+ +# the Free Software Foundation; either version 2.1 of the License, or
+ +# (at your option) any later version.
+ +
+ +prefix=@prefix@
+ +exec_prefix=@exec_prefix@
+ +libdir=@libdir@
+ +includedir=@includedir@
+ +
+ +Name: systemd
+ +Description: systemd D-Bus client library
+ +URL: @PACKAGE_URL@
+ +Version: @PACKAGE_VERSION@
+ +Requires: libsystemd-daemon = @PACKAGE_VERSION@
+ +Libs: -L${libdir} -lsystemd-bus
+ +Cflags: -I${includedir} -I${includedir}/systemd -I${includedir}/systemd/bus
+ diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
+ index 7d6d848..7a21ad6 100644
+ --- a/src/libsystemd-bus/sd-bus.c
+ +++ b/src/libsystemd-bus/sd-bus.c
+ @@ -92,7 +92,7 @@ static void bus_free(sd_bus *b) {
+ free(b);
+ }
+
+ -int sd_bus_new(sd_bus **ret) {
+ +_public_ int sd_bus_new(sd_bus **ret) {
+ sd_bus *r;
+
+ if (!ret)
+ @@ -119,7 +119,7 @@ int sd_bus_new(sd_bus **ret) {
+ return 0;
+ }
+
+ -int sd_bus_set_address(sd_bus *bus, const char *address) {
+ +_public_ int sd_bus_set_address(sd_bus *bus, const char *address) {
+ char *a;
+
+ if (!bus)
+ @@ -139,7 +139,7 @@ int sd_bus_set_address(sd_bus *bus, const char *address) {
+ return 0;
+ }
+
+ -int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd) {
+ +_public_ int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd) {
+ if (!bus)
+ return -EINVAL;
+ if (bus->state != BUS_UNSET)
+ @@ -154,7 +154,7 @@ int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd) {
+ return 0;
+ }
+
+ -int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) {
+ +_public_ int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) {
+ char *p, **a;
+
+ if (!bus)
+ @@ -185,7 +185,7 @@ int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) {