From: Enrico Scholz Date: Sun, 3 Jul 2005 17:49:57 +0000 (+0000) Subject: - s!VCMD_vx_.et_vhi_name!VCMD_.et_vhi_name! X-Git-Tag: version_0_30_210~148 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79404ec097c6510e019a04b16be3543ed22ae9ca;p=util-vserver.git - s!VCMD_vx_.et_vhi_name!VCMD_.et_vhi_name! - added workaround for older kernels not having the naming above git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2133 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/lib/syscall_getvhiname-v13.hc b/util-vserver/lib/syscall_getvhiname-v13.hc index 5fa8aec..2dccaae 100644 --- a/util-vserver/lib/syscall_getvhiname-v13.hc +++ b/util-vserver/lib/syscall_getvhiname-v13.hc @@ -22,15 +22,23 @@ #include + // HACK: workaround naming changes instead of defining yet another interface + // version +#if !defined(VCMD_get_vhi_name) && defined(VCMD_vx_get_vhi_name) +# define VCMD_get_vhi_name VCMD_vx_get_vhi_name +# define vcmd_vhi_name_v0 vcmd_vxi_vhi_name_v0 +#endif + + static inline ALWAYSINLINE int vc_get_vhi_name_v13(xid_t xid, vc_uts_type type, char *val, size_t len) { - struct vcmd_vx_vhi_name_v0 cmd; + struct vcmd_vhi_name_v0 cmd; int rc; size_t l = sizeof(cmd.name); cmd.field = VHI_USER2KERNEL(type); - rc = vserver(VCMD_vx_get_vhi_name, CTX_USER2KERNEL(xid), &cmd); + rc = vserver(VCMD_get_vhi_name, CTX_USER2KERNEL(xid), &cmd); ENSC_FIX_IOCTL(rc); if (rc==-1) return -1; diff --git a/util-vserver/lib/syscall_setvhiname-v13.hc b/util-vserver/lib/syscall_setvhiname-v13.hc index 2d98099..2274517 100644 --- a/util-vserver/lib/syscall_setvhiname-v13.hc +++ b/util-vserver/lib/syscall_setvhiname-v13.hc @@ -22,10 +22,17 @@ #include + // HACK: workaround naming changes instead of defining yet another interface + // version +#if !defined(VCMD_set_vhi_name) && defined(VCMD_vx_set_vhi_name) +# define VCMD_set_vhi_name VCMD_vx_set_vhi_name +# define vcmd_vhi_name_v0 vcmd_vxi_vhi_name_v0 +#endif + static inline ALWAYSINLINE int vc_set_vhi_name_v13(xid_t xid, vc_uts_type type, char const *val, size_t len) { - struct vcmd_vx_vhi_name_v0 cmd; + struct vcmd_vhi_name_v0 cmd; int rc; if (len>=sizeof(cmd.name)) { @@ -37,7 +44,7 @@ vc_set_vhi_name_v13(xid_t xid, vc_uts_type type, char const *val, size_t len) memcpy(cmd.name, val, len); cmd.name[len] = '\0'; - rc = vserver(VCMD_vx_set_vhi_name, CTX_USER2KERNEL(xid), &cmd); + rc = vserver(VCMD_set_vhi_name, CTX_USER2KERNEL(xid), &cmd); ENSC_FIX_IOCTL(rc); return rc;