All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Thomas Klausner <tk@giga.or.at>
Cc: alsa-devel@alsa-project.org
Subject: Re: portability patch: EBADF [was Re: feeding back pkgsrc changs]
Date: Tue, 23 Feb 2016 16:53:51 +0100	[thread overview]
Message-ID: <s5h4mczzals.wl-tiwai@suse.de> (raw)
In-Reply-To: <20160223140906.GP19194@danbala.tuwien.ac.at>

On Tue, 23 Feb 2016 15:09:06 +0100,
Thomas Klausner wrote:
> 
> Hi Takashi!
> 
> Thanks for the answer.
> 
> On Thu, Feb 18, 2016 at 04:51:15PM +0100, Takashi Iwai wrote:
> > On Thu, 18 Feb 2016 16:47:44 +0100,
> > Thomas Klausner wrote:
> > > I've just updated the pkgsrc packages for alsa-lib, alsa-utils and
> > > alsa-plugins to 1.1.0 and noticed that there are quite a number of
> > > local patches we have. I'd like to get them integrated.
> > > 
> > > When I visited the alsa-projects web page, I noticed that the link to
> > > the bug tracker is dead.
> > > 
> > > What is the recommended method to provide the patches?
> > 
> > Just submit your patches to alsa-devel ML.  That's the best way to
> > review and get merged.
> 
> I'll start with a straightforward one. Some operating systems don't
> provide an errno 'EBADFD'; let's use EBADF there instead.
> 
> This patch adds the define in all files that need it, but if you
> prefer to add it to a central place instead, please suggest one.

How about put this in include/local.h instead?  Then we need to put it
only in one place, as this is supposed to be included by all codes.


Takashi


> 
> Thanks,
>  Thomas
> >From e72e16bcb9bd2ddff2624fdb57a96fad6b3cf5bb Mon Sep 17 00:00:00 2001
> From: Thomas Klausner <wiz@NetBSD.org>
> Date: Tue, 23 Feb 2016 15:05:47 +0100
> Subject: [PATCH] Define EBADFD in terms of EBADF if it doesn't exist.
> 
> For portability on FreeBSD, NetBSD and probably others.
> ---
>  aserver/aserver.c         | 4 ++++
>  src/control/control_shm.c | 4 ++++
>  src/pcm/pcm.c             | 4 ++++
>  src/pcm/pcm_dmix.c        | 4 ++++
>  src/pcm/pcm_dshare.c      | 4 ++++
>  src/pcm/pcm_dsnoop.c      | 4 ++++
>  src/pcm/pcm_hw.c          | 4 ++++
>  src/pcm/pcm_ioplug.c      | 4 ++++
>  src/pcm/pcm_null.c        | 4 ++++
>  src/pcm/pcm_rate.c        | 4 ++++
>  src/pcm/pcm_share.c       | 4 ++++
>  src/pcm/pcm_shm.c         | 4 ++++
>  src/pcm/pcm_simple.c      | 4 ++++
>  13 files changed, 52 insertions(+)
> 
> diff --git a/aserver/aserver.c b/aserver/aserver.c
> index ac20706..88995cf 100644
> --- a/aserver/aserver.c
> +++ b/aserver/aserver.c
> @@ -35,6 +35,10 @@
>  
>  #include "aserver.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  char *command;
>  
>  #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
> diff --git a/src/control/control_shm.c b/src/control/control_shm.c
> index bd07d4a..618ef39 100644
> --- a/src/control/control_shm.c
> +++ b/src/control/control_shm.c
> @@ -35,6 +35,10 @@
>  #include <netdb.h>
>  #include "aserver.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  #ifndef PIC
>  /* entry for static linking */
>  const char *_snd_module_control_shm = "";
> diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
> index 203e7a5..6d40171 100644
> --- a/src/pcm/pcm.c
> +++ b/src/pcm/pcm.c
> @@ -639,6 +639,10 @@ playback devices.
>  #include <limits.h>
>  #include "pcm_local.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  /**
>   * \brief get identifier of PCM handle
>   * \param pcm PCM handle
> diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
> index b26a5c7..ba65cad 100644
> --- a/src/pcm/pcm_dmix.c
> +++ b/src/pcm/pcm_dmix.c
> @@ -45,6 +45,10 @@
>  #include <sys/mman.h>
>  #include "pcm_direct.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  #ifndef PIC
>  /* entry for static linking */
>  const char *_snd_module_pcm_dmix = "";
> diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
> index 58e47bb..2556a30 100644
> --- a/src/pcm/pcm_dshare.c
> +++ b/src/pcm/pcm_dshare.c
> @@ -45,6 +45,10 @@
>  #include <sys/mman.h>
>  #include "pcm_direct.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  #ifndef PIC
>  /* entry for static linking */
>  const char *_snd_module_pcm_dshare = "";
> diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
> index 576c35b..26b6f5c 100644
> --- a/src/pcm/pcm_dsnoop.c
> +++ b/src/pcm/pcm_dsnoop.c
> @@ -45,6 +45,10 @@
>  #include <sys/mman.h>
>  #include "pcm_direct.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  #ifndef PIC
>  /* entry for static linking */
>  const char *_snd_module_pcm_dsnoop = "";
> diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
> index 4f4b84b..de9f9d5 100644
> --- a/src/pcm/pcm_hw.c
> +++ b/src/pcm/pcm_hw.c
> @@ -40,6 +40,10 @@
>  #include "../control/control_local.h"
>  #include "../timer/timer_local.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  //#define DEBUG_RW		/* use to debug readi/writei/readn/writen */
>  //#define DEBUG_MMAP		/* debug mmap_commit */
>  
> diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c
> index 43550c0..bed1c97 100644
> --- a/src/pcm/pcm_ioplug.c
> +++ b/src/pcm/pcm_ioplug.c
> @@ -31,6 +31,10 @@
>  #include "pcm_ext_parm.h"
>  #include "pcm_generic.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  #ifndef PIC
>  /* entry for static linking */
>  const char *_snd_module_pcm_ioplug = "";
> diff --git a/src/pcm/pcm_null.c b/src/pcm/pcm_null.c
> index 5e63caa..9fe3c82 100644
> --- a/src/pcm/pcm_null.c
> +++ b/src/pcm/pcm_null.c
> @@ -31,6 +31,10 @@
>  #include "pcm_local.h"
>  #include "pcm_plugin.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  #ifndef PIC
>  /* entry for static linking */
>  const char *_snd_module_pcm_null = "";
> diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
> index c76db25..c08a2e8 100644
> --- a/src/pcm/pcm_rate.c
> +++ b/src/pcm/pcm_rate.c
> @@ -36,6 +36,10 @@
>  
>  #include "plugin_ops.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  #if 0
>  #define DEBUG_REFINE
>  #endif
> diff --git a/src/pcm/pcm_share.c b/src/pcm/pcm_share.c
> index 5d8aaf2..9fe8dc1 100644
> --- a/src/pcm/pcm_share.c
> +++ b/src/pcm/pcm_share.c
> @@ -38,6 +38,10 @@
>  #include <pthread.h>
>  #include "pcm_local.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  #ifndef PIC
>  /* entry for static linking */
>  const char *_snd_module_pcm_share = "";
> diff --git a/src/pcm/pcm_shm.c b/src/pcm/pcm_shm.c
> index a815ac6..242b26e 100644
> --- a/src/pcm/pcm_shm.c
> +++ b/src/pcm/pcm_shm.c
> @@ -45,6 +45,10 @@
>  #include <netdb.h>
>  #include "aserver.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  #ifndef PIC
>  /* entry for static linking */
>  const char *_snd_module_pcm_shm = "";
> diff --git a/src/pcm/pcm_simple.c b/src/pcm/pcm_simple.c
> index ce11083..99ba1c3 100644
> --- a/src/pcm/pcm_simple.c
> +++ b/src/pcm/pcm_simple.c
> @@ -25,6 +25,10 @@
>  
>  #include "pcm_local.h"
>  
> +#ifndef EBADFD
> +#define EBADFD EBADF
> +#endif
> +
>  static int set_buffer_time(snd_spcm_latency_t latency,
>  			   unsigned int *buffer_time)
>  {
> -- 
> 2.7.1
> 

  reply	other threads:[~2016-02-23 15:53 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 15:47 feeding back pkgsrc changs Thomas Klausner
2016-02-18 15:51 ` Takashi Iwai
2016-02-23 14:09   ` portability patch: EBADF [was Re: feeding back pkgsrc changs] Thomas Klausner
2016-02-23 15:53     ` Takashi Iwai [this message]
2016-02-24 13:16       ` Thomas Klausner
2016-02-24 15:36         ` Takashi Iwai
2016-02-25 23:31           ` portability: types Thomas Klausner
2016-02-26  8:45             ` Clemens Ladisch
2016-02-29 15:05               ` [PATCH 1/3] Use POSIX uint*_t instead of u_int*_t Thomas Klausner
2016-02-29 15:05                 ` [PATCH 2/3] Use pid_t, off_t instead of __kernel_*_t for better portability Thomas Klausner
2016-02-29 16:10                   ` Takashi Iwai
2016-03-02 22:14                     ` [PATCH] define more missing types for non-Linux Thomas Klausner
2016-03-03  9:32                       ` Takashi Iwai
2016-03-03  9:50                         ` Thomas Klausner
2016-03-03  9:53                           ` Takashi Iwai
2016-03-03  9:55                             ` Takashi Iwai
2016-03-03  9:58                               ` Thomas Klausner
2016-03-03 10:01                                 ` Takashi Iwai
2016-03-03 10:10                                   ` byteswap.h Thomas Klausner
2016-03-03 10:21                                     ` byteswap.h Takashi Iwai
2016-03-03 11:18                                       ` byteswap.h Thomas Klausner
2016-03-03 11:37                                         ` byteswap.h Takashi Iwai
2016-03-03 11:39                                           ` byteswap.h Thomas Klausner
2016-03-03 12:02                                             ` Remaining compatibility patches for NetBSD Thomas Klausner
2016-03-03 13:35                                               ` Takashi Iwai
2016-03-03 13:46                                                 ` Thomas Klausner
2016-03-03 13:54                                                   ` Takashi Iwai
2016-03-03 14:23                                                     ` Thomas Klausner
2016-02-29 15:05                 ` [PATCH 3/3] Use uint*_t instead of __le* Thomas Klausner
2016-02-29 15:10                   ` [PATCH 4/4] Replace __u* with uint*_t Thomas Klausner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h4mczzals.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=tk@giga.or.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.