Message ID | 20180423123109.18590-3-christian.storm@siemens.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/8] core: warn about non-Linux parent SIGTERM tracking | expand |
On 23/04/2018 14:31, Christian Storm wrote: > As ENODATA is not available on FreeBSD, return > ENOATTR instead which is close enough. > > Signed-off-by: Thomas Zander <thomas.zander@siemens.com> > Signed-off-by: Christian Storm <christian.storm@siemens.com> > --- > corelib/swupdate_settings.c | 1 + > include/compat.h | 10 ++++++++++ > 2 files changed, 11 insertions(+) > > diff --git a/corelib/swupdate_settings.c b/corelib/swupdate_settings.c > index 9a5043a..ec726f2 100644 > --- a/corelib/swupdate_settings.c > +++ b/corelib/swupdate_settings.c > @@ -25,6 +25,7 @@ > #include "swupdate.h" > #include "parselib.h" > #include "swupdate_settings.h" > +#include "compat.h" > > struct run_as { > uid_t userid; > diff --git a/include/compat.h b/include/compat.h > index 29d7af1..a98a388 100644 > --- a/include/compat.h > +++ b/include/compat.h > @@ -22,3 +22,13 @@ > (char *)memcpy(__out, __in, __len - 1); \ > })) > #endif > + > +#if defined(__FreeBSD__) > +/* > + * Define ENODATA (61 - No data available) to > + * ENOATTR (87 - Attribute not found) on FreeBSD > + * since that's closest to Linux's ENODATA, and > + * 61 on FreeBSD is ECONNREFUSED. > + */ > +#define ENODATA ENOATTR > +#endif > Reviewed-by: Stefano Babic <sbabic@denx.de> Best regards, Stefano Babic
diff --git a/corelib/swupdate_settings.c b/corelib/swupdate_settings.c index 9a5043a..ec726f2 100644 --- a/corelib/swupdate_settings.c +++ b/corelib/swupdate_settings.c @@ -25,6 +25,7 @@ #include "swupdate.h" #include "parselib.h" #include "swupdate_settings.h" +#include "compat.h" struct run_as { uid_t userid; diff --git a/include/compat.h b/include/compat.h index 29d7af1..a98a388 100644 --- a/include/compat.h +++ b/include/compat.h @@ -22,3 +22,13 @@ (char *)memcpy(__out, __in, __len - 1); \ })) #endif + +#if defined(__FreeBSD__) +/* + * Define ENODATA (61 - No data available) to + * ENOATTR (87 - Attribute not found) on FreeBSD + * since that's closest to Linux's ENODATA, and + * 61 on FreeBSD is ECONNREFUSED. + */ +#define ENODATA ENOATTR +#endif