Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Jansson API instead of YAJL #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

lsm5
Copy link

@lsm5 lsm5 commented Aug 2, 2018

YAJL upstream has been pretty much dead for a while now.

Signed-off-by: Lokesh Mandvekar [email protected]

modified: Makefile.am
modified: configure.ac
modified: src/systemdhook.c

@mrunalp @rhatdan I'm able to run containers with this commit. Let me know if there's any other testing needed.

YAJL upstream has been pretty much dead for a while now.

Signed-off-by: Lokesh Mandvekar <[email protected]>

modified:   Makefile.am
modified:   configure.ac
modified:   src/systemdhook.c
@rhatdan
Copy link
Member

rhatdan commented Aug 2, 2018

Can you clean up some of the compiler warnings?

src/systemdhook.c: In function ‘main’:
src/systemdhook.c:842:25: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  char *container_uuid = json_string_value(v_id);
                         ^~~~~~~~~~~~~~~~~
src/systemdhook.c:860:11: warning: unused variable ‘v_bundle_path’ [-Wunused-variable]
   json_t *v_bundle_path = json_object_get(node, "bundlePath");
           ^~~~~~~~~~~~~
src/systemdhook.c:907:20: warning: initialization of ‘json_t *’ {aka ‘struct json_t *’} from ‘size_t’ {aka ‘long unsigned int’} makes pointer from integer without a cast [-Wint-conversion]
    json_t *v_env = json_array_size(v_envs);
                    ^~~~~~~~~~~~~~~
src/systemdhook.c:908:16: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    char *str = json_string_value(v_env);
                ^~~~~~~~~~~~~~~~~
src/systemdhook.c:936:26: warning: passing argument 1 of ‘json_string_value’ makes pointer from integer without a cast [-Wint-conversion]
  cmd = json_string_value(v_arg0_value);
                          ^~~~~~~~~~~~
In file included from src/systemdhook.c:21:
/usr/include/jansson.h:266:13: note: expected ‘const json_t *’ {aka ‘const struct json_t *’} but argument is of type ‘size_t’ {aka ‘long unsigned int’}
 const char *json_string_value(const json_t *string);
             ^~~~~~~~~~~~~~~~~
src/systemdhook.c:936:6: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  cmd = json_string_value(v_arg0_value);
      ^
src/systemdhook.c:956:17: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  char *rootfs = json_string_value(v_root);
                 ^~~~~~~~~~~~~~~~~
src/systemdhook.c:990:43: warning: passing argument 1 of ‘json_object_get’ makes pointer from integer without a cast [-Wint-conversion]
   json_t *v_destination = json_object_get(v_mounts_values, "destination");
                                           ^~~~~~~~~~~~~~~
In file included from src/systemdhook.c:21:
/usr/include/jansson.h:188:9: note: expected ‘const json_t *’ {aka ‘const struct json_t *’} but argument is of type ‘size_t’ {aka ‘long unsigned int’}
 json_t *json_object_get(const json_t *object, const char *key);
         ^~~~~~~~~~~~~~~
src/systemdhook.c:1017:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   mount_label = v_mount ? json_string_value(v_mount) : "";
               ^
src/systemdhook.c:1039:45: warning: passing argument 1 of ‘json_object_get’ makes pointer from integer without a cast [-Wint-conversion]
     json_t *v_containerId = json_object_get(v_gidMappings_values, "containerID");
                                             ^~~~~~~~~~~~~~~~~~~~
In file included from src/systemdhook.c:21:
/usr/include/jansson.h:188:9: note: expected ‘const json_t *’ {aka ‘const struct json_t *’} but argument is of type ‘size_t’ {aka ‘long unsigned int’}
 json_t *json_object_get(const json_t *object, const char *key);
         ^~~~~~~~~~~~~~~
src/systemdhook.c:1041:38: warning: passing argument 1 of ‘json_object_get’ makes pointer from integer without a cast [-Wint-conversion]
      json_t *v_gid = json_object_get(v_gidMappings_values, "hostID");
                                      ^~~~~~~~~~~~~~~~~~~~
In file included from src/systemdhook.c:21:
/usr/include/jansson.h:188:9: note: expected ‘const json_t *’ {aka ‘const struct json_t *’} but argument is of type ‘size_t’ {aka ‘long unsigned int’}
 json_t *json_object_get(const json_t *object, const char *key);
         ^~~~~~~~~~~~~~~
src/systemdhook.c:1069:45: warning: passing argument 1 of ‘json_object_get’ makes pointer from integer without a cast [-Wint-conversion]
     json_t *v_containerId = json_object_get(v_uidMappings_values, "containerID");
                                             ^~~~~~~~~~~~~~~~~~~~
In file included from src/systemdhook.c:21:
/usr/include/jansson.h:188:9: note: expected ‘const json_t *’ {aka ‘const struct json_t *’} but argument is of type ‘size_t’ {aka ‘long unsigned int’}
 json_t *json_object_get(const json_t *object, const char *key);
         ^~~~~~~~~~~~~~~
src/systemdhook.c:1071:38: warning: passing argument 1 of ‘json_object_get’ makes pointer from integer without a cast [-Wint-conversion]
      json_t *v_uid = json_object_get(v_uidMappings_values, "hostID");
                                      ^~~~~~~~~~~~~~~~~~~~
In file included from src/systemdhook.c:21:
/usr/include/jansson.h:188:9: note: expected ‘const json_t *’ {aka ‘const struct json_t *’} but argument is of type ‘size_t’ {aka ‘long unsigned int’}
 json_t *json_object_get(const json_t *object, const char *key);
         ^~~~~~~~~~~~~~~
mv -f src/.deps/oci_systemd_hook-systemdhook.Tpo src/.deps/oci_systemd_hook-systemdhook.Po
gcc -Wall -Wextra -std=c99   -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid  -g -O2   -o oci-systemd-hook src/oci_systemd_hook-systemdhook.o -ljansson  -lselinux  -lmount  
make[1]: Leaving directory '/home/dwalsh/oci/oci-systemd-hook'

@lsm5
Copy link
Author

lsm5 commented Aug 2, 2018

ha, will do :)

@rhatdan
Copy link
Member

rhatdan commented Aug 8, 2018

@lsm5 Any progress on this?

@lsm5
Copy link
Author

lsm5 commented Aug 8, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants