lkml.org 
[lkml]   [2004]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.6.8-rc2-mm1
Johannes Stezenbach <js@convergence.de> wrote:
>
> This is a hack introduced by someone years ago. The "pointer" is
> actually an integer argument, e.g. in include/linux/dvb/audio.h:
>
> #define AUDIO_SET_MUTE _IO('o', 6)
>
> actually takes an integer argument (!0 mute, 0 unmute), so one can write
>
> if (ioctl(fd, AUDIO_SET_MUTE, 1) == -1)
> perror("mute");

Is it a boolean argument?

If so, we could change the code to do

parg = (void *)(arg ? 1 : 0);

so if someone dereferences it they'll get a nice oops.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [from the cache]
©2003-2011 Jasper Spaans