All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP]  [PATCH] mount/mount06.c: fix a compile error
@ 2013-07-30  3:31 DAN LI
  2013-07-30  3:40 ` Wanlong Gao
  0 siblings, 1 reply; 6+ messages in thread
From: DAN LI @ 2013-07-30  3:31 UTC (permalink / raw)
  To: LTP list


The definitions of MS_PRIVATE and MS_MOVE were only added to glibc headers
in version 2.12.

If the version of glibc is older than 2.12, define these two flags.

Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
---
 testcases/kernel/syscalls/mount/mount06.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/syscalls/mount/mount06.c b/testcases/kernel/syscalls/mount/mount06.c
index acfb22d..ab1a472 100644
--- a/testcases/kernel/syscalls/mount/mount06.c
+++ b/testcases/kernel/syscalls/mount/mount06.c
@@ -31,6 +31,11 @@
 #include "usctest.h"
 #include "safe_macros.h"

+#if !(__GLIBC_PREREQ(2, 12))
+#define MS_MOVE	8192
+#define MS_PRIVATE	(1 << 18)
+#endif
+
 #define MNTPOINT_SRC	"mnt_src"
 #define MNTPOINT_DES	"mnt_des"
 #define LINELENGTH	256
-- 
1.7.1

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] mount/mount06.c: fix a compile error
  2013-07-30  3:31 [LTP] [PATCH] mount/mount06.c: fix a compile error DAN LI
@ 2013-07-30  3:40 ` Wanlong Gao
  2013-07-30  4:16   ` DAN LI
  0 siblings, 1 reply; 6+ messages in thread
From: Wanlong Gao @ 2013-07-30  3:40 UTC (permalink / raw)
  To: DAN LI; +Cc: LTP list

On 07/30/2013 11:31 AM, DAN LI wrote:
> 
> The definitions of MS_PRIVATE and MS_MOVE were only added to glibc headers
> in version 2.12.
> 
> If the version of glibc is older than 2.12, define these two flags.
> 
> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
> ---
>  testcases/kernel/syscalls/mount/mount06.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/mount/mount06.c b/testcases/kernel/syscalls/mount/mount06.c
> index acfb22d..ab1a472 100644
> --- a/testcases/kernel/syscalls/mount/mount06.c
> +++ b/testcases/kernel/syscalls/mount/mount06.c
> @@ -31,6 +31,11 @@
>  #include "usctest.h"
>  #include "safe_macros.h"
> 
> +#if !(__GLIBC_PREREQ(2, 12))

Why not do like below?
#ifndef MS_MOVE
#define xxx
#define xxx
#endif

Wanlong Gao

> +#define MS_MOVE	8192
> +#define MS_PRIVATE	(1 << 18)
> +#endif
> +
>  #define MNTPOINT_SRC	"mnt_src"
>  #define MNTPOINT_DES	"mnt_des"
>  #define LINELENGTH	256
> 


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] mount/mount06.c: fix a compile error
  2013-07-30  3:40 ` Wanlong Gao
@ 2013-07-30  4:16   ` DAN LI
  2013-07-30  8:19     ` Benoit Marcot
  2013-07-30  9:59     ` chrubis
  0 siblings, 2 replies; 6+ messages in thread
From: DAN LI @ 2013-07-30  4:16 UTC (permalink / raw)
  To: gaowanlong; +Cc: LTP list

On 07/30/2013 11:40 AM, Wanlong Gao wrote:
> On 07/30/2013 11:31 AM, DAN LI wrote:
>>
>> The definitions of MS_PRIVATE and MS_MOVE were only added to glibc headers
>> in version 2.12.
>>
>> If the version of glibc is older than 2.12, define these two flags.
>>
>> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
>> ---
>>  testcases/kernel/syscalls/mount/mount06.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/testcases/kernel/syscalls/mount/mount06.c b/testcases/kernel/syscalls/mount/mount06.c
>> index acfb22d..ab1a472 100644
>> --- a/testcases/kernel/syscalls/mount/mount06.c
>> +++ b/testcases/kernel/syscalls/mount/mount06.c
>> @@ -31,6 +31,11 @@
>>  #include "usctest.h"
>>  #include "safe_macros.h"
>>
>> +#if !(__GLIBC_PREREQ(2, 12))
> 
> Why not do like below?

I think it also clearly shows the reason why this definition should
exist here(glibc version related).

Regards,
DAN LI

> #ifndef MS_MOVE
> #define xxx
> #define xxx
> #endif
> 
> Wanlong Gao
> 
>> +#define MS_MOVE	8192
>> +#define MS_PRIVATE	(1 << 18)
>> +#endif
>> +
>>  #define MNTPOINT_SRC	"mnt_src"
>>  #define MNTPOINT_DES	"mnt_des"
>>  #define LINELENGTH	256
>>
> 
> 



------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] mount/mount06.c: fix a compile error
  2013-07-30  4:16   ` DAN LI
@ 2013-07-30  8:19     ` Benoit Marcot
  2013-07-30  8:32       ` Benoit Marcot
  2013-07-30  9:59     ` chrubis
  1 sibling, 1 reply; 6+ messages in thread
From: Benoit Marcot @ 2013-07-30  8:19 UTC (permalink / raw)
  To: DAN LI, gaowanlong@cn.fujitsu.com; +Cc: LTP list

Hi!

I had the same problem to compile the latest commits; I patched in the same way as testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c:

#ifndef MS_MOVE
#define MS_MOVE         8192
#endif

Benoit

> -----Original Message-----
> From: DAN LI [mailto:li.dan@cn.fujitsu.com]
> Sent: 30 July 2013 05:16
> To: gaowanlong@cn.fujitsu.com
> Cc: LTP list
> Subject: Re: [LTP] [PATCH] mount/mount06.c: fix a compile error
>
> On 07/30/2013 11:40 AM, Wanlong Gao wrote:
> > On 07/30/2013 11:31 AM, DAN LI wrote:
> >>
> >> The definitions of MS_PRIVATE and MS_MOVE were only added to glibc
> >> headers in version 2.12.
> >>
> >> If the version of glibc is older than 2.12, define these two flags.
> >>
> >> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
> >> ---
> >>  testcases/kernel/syscalls/mount/mount06.c |    5 +++++
> >>  1 files changed, 5 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/testcases/kernel/syscalls/mount/mount06.c
> >> b/testcases/kernel/syscalls/mount/mount06.c
> >> index acfb22d..ab1a472 100644
> >> --- a/testcases/kernel/syscalls/mount/mount06.c
> >> +++ b/testcases/kernel/syscalls/mount/mount06.c
> >> @@ -31,6 +31,11 @@
> >>  #include "usctest.h"
> >>  #include "safe_macros.h"
> >>
> >> +#if !(__GLIBC_PREREQ(2, 12))
> >
> > Why not do like below?
>
> I think it also clearly shows the reason why this definition should exist
> here(glibc version related).
>
> Regards,
> DAN LI
>
> > #ifndef MS_MOVE
> > #define xxx
> > #define xxx
> > #endif
> >
> > Wanlong Gao
> >
> >> +#define MS_MOVE   8192
> >> +#define MS_PRIVATE        (1 << 18)
> >> +#endif
> >> +
> >>  #define MNTPOINT_SRC      "mnt_src"
> >>  #define MNTPOINT_DES      "mnt_des"
> >>  #define LINELENGTH        256
> >>
> >
> >
>
>
>
> ------------------------------------------------------------------------------
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent caught
> up. So what steps can you take to put your SQL databases under version
> control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clk
> trk
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] mount/mount06.c: fix a compile error
  2013-07-30  8:19     ` Benoit Marcot
@ 2013-07-30  8:32       ` Benoit Marcot
  0 siblings, 0 replies; 6+ messages in thread
From: Benoit Marcot @ 2013-07-30  8:32 UTC (permalink / raw)
  To: LTP list

In the other hand Dan's patch gives a hint about *why* it's failing to compile, which is nice.

> -----Original Message-----
> From: Benoit Marcot [mailto:Benoit.Marcot@arm.com]
> Sent: 30 July 2013 09:19
> To: DAN LI; gaowanlong@cn.fujitsu.com
> Cc: LTP list
> Subject: Re: [LTP] [PATCH] mount/mount06.c: fix a compile error
>
> Hi!
>
> I had the same problem to compile the latest commits; I patched in the same
> way as testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c:
>
> #ifndef MS_MOVE
> #define MS_MOVE         8192
> #endif
>
> Benoit
>
> > -----Original Message-----
> > From: DAN LI [mailto:li.dan@cn.fujitsu.com]
> > Sent: 30 July 2013 05:16
> > To: gaowanlong@cn.fujitsu.com
> > Cc: LTP list
> > Subject: Re: [LTP] [PATCH] mount/mount06.c: fix a compile error
> >
> > On 07/30/2013 11:40 AM, Wanlong Gao wrote:
> > > On 07/30/2013 11:31 AM, DAN LI wrote:
> > >>
> > >> The definitions of MS_PRIVATE and MS_MOVE were only added to glibc
> > >> headers in version 2.12.
> > >>
> > >> If the version of glibc is older than 2.12, define these two flags.
> > >>
> > >> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
> > >> ---
> > >>  testcases/kernel/syscalls/mount/mount06.c |    5 +++++
> > >>  1 files changed, 5 insertions(+), 0 deletions(-)
> > >>
> > >> diff --git a/testcases/kernel/syscalls/mount/mount06.c
> > >> b/testcases/kernel/syscalls/mount/mount06.c
> > >> index acfb22d..ab1a472 100644
> > >> --- a/testcases/kernel/syscalls/mount/mount06.c
> > >> +++ b/testcases/kernel/syscalls/mount/mount06.c
> > >> @@ -31,6 +31,11 @@
> > >>  #include "usctest.h"
> > >>  #include "safe_macros.h"
> > >>
> > >> +#if !(__GLIBC_PREREQ(2, 12))
> > >
> > > Why not do like below?
> >
> > I think it also clearly shows the reason why this definition should
> > exist here(glibc version related).
> >
> > Regards,
> > DAN LI
> >
> > > #ifndef MS_MOVE
> > > #define xxx
> > > #define xxx
> > > #endif
> > >
> > > Wanlong Gao
> > >
> > >> +#define MS_MOVE   8192
> > >> +#define MS_PRIVATE        (1 << 18)
> > >> +#endif
> > >> +
> > >>  #define MNTPOINT_SRC      "mnt_src"
> > >>  #define MNTPOINT_DES      "mnt_des"
> > >>  #define LINELENGTH        256
> > >>
> > >
> > >
> >
> >
> >
> > ----------------------------------------------------------------------
> > -------- Get your SQL database under version control now!
> > Version control is standard for application code, but databases havent
> > caught up. So what steps can you take to put your SQL databases under
> > version control? Why should you start doing it? Read more to find out.
> > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.c
> > lk
> > trk
> > _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
>
>
> -- IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended recipient,
> please notify the sender immediately and do not disclose the contents to any
> other person, use it for any purpose, or store or copy the information in any
> medium.  Thank you.
>
>
> ------------------------------------------------------------------------------
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent caught
> up. So what steps can you take to put your SQL databases under version
> control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clk
> trk
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] mount/mount06.c: fix a compile error
  2013-07-30  4:16   ` DAN LI
  2013-07-30  8:19     ` Benoit Marcot
@ 2013-07-30  9:59     ` chrubis
  1 sibling, 0 replies; 6+ messages in thread
From: chrubis @ 2013-07-30  9:59 UTC (permalink / raw)
  To: DAN LI; +Cc: LTP list

Hi!
> >> The definitions of MS_PRIVATE and MS_MOVE were only added to glibc headers
> >> in version 2.12.
> >>
> >> If the version of glibc is older than 2.12, define these two flags.
> >>
> >> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
> >> ---
> >>  testcases/kernel/syscalls/mount/mount06.c |    5 +++++
> >>  1 files changed, 5 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/testcases/kernel/syscalls/mount/mount06.c b/testcases/kernel/syscalls/mount/mount06.c
> >> index acfb22d..ab1a472 100644
> >> --- a/testcases/kernel/syscalls/mount/mount06.c
> >> +++ b/testcases/kernel/syscalls/mount/mount06.c
> >> @@ -31,6 +31,11 @@
> >>  #include "usctest.h"
> >>  #include "safe_macros.h"
> >>
> >> +#if !(__GLIBC_PREREQ(2, 12))
> > 
> > Why not do like below?
> 
> I think it also clearly shows the reason why this definition should
> exist here(glibc version related).

Well the same is told in the git commit log anyway.
(Which is the place where people should look for verbose description of
 changes.)

And this kind of code may break with different libc implementation where
there is no __GLIBC_PREREQ() macro.


So I vote for the:

#ifndef FOO
# define FOO xyz
#endif

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-30  9:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-30  3:31 [LTP] [PATCH] mount/mount06.c: fix a compile error DAN LI
2013-07-30  3:40 ` Wanlong Gao
2013-07-30  4:16   ` DAN LI
2013-07-30  8:19     ` Benoit Marcot
2013-07-30  8:32       ` Benoit Marcot
2013-07-30  9:59     ` chrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.