! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Drop include on deprecated sys/sysctl.h
Status:
RESOLVED: FIXED
Product:
Xfce4-battery-plugin
Component:
General

Comments

Description Yves-Alexis Perez editbugs 2019-01-14 13:34:29 CET
Hi,

sys/sysctl.h is obsolete/deprecated, so there's no need to include it at all. Also, right now if it's not available, it will fail to build because it also won't include err.h and errno.h.
Comment 1 Yves-Alexis Perez editbugs 2019-01-14 13:37:21 CET
It fails to build on architectures like x32 or arm64, for example
Comment 2 Git Bot editbugs 2019-01-20 21:03:30 CET
Andre Miranda referenced this bugreport in commit 7eb89d5577544d6f7bb839420008092ac8108f45

Remove unnecessary header includes (Bug #15039)

https://git.xfce.org/panel-plugins/xfce4-battery-plugin/commit?id=7eb89d5577544d6f7bb839420008092ac8108f45
Comment 3 Andre Miranda editbugs 2019-01-20 21:04:07 CET
Fixed, thanks!
Comment 4 Landry Breuil editbugs 2019-01-22 22:00:19 CET
Breaks freebsd as found out by skunnyk with https://buildbot.xfce.alteroot.org/job/xfce4-battery-plugin/nodes=FreeBSD/13/console
Comment 5 Andre Miranda editbugs 2019-01-23 01:11:11 CET
Created attachment 8261 
headers.diff

And that kids, that's why we have a CI.... but I didn't remember to check it, shame on me!
@Landry, what do you think of the attached patch? Does it fix the problem on OpenBSD?
Comment 6 Landry Breuil editbugs 2019-01-24 08:09:43 CET
Comment on attachment 8261 
headers.diff

Much better with the patch as master now builds fine on OpenBSd with it, but i dont really like #include scattered around .c files - wouldnt it be better to add a #ifdef block with them at the top ?
Comment 7 Andre Miranda editbugs 2019-01-25 01:10:42 CET
I don't mind about where the headers are included, would you prefer another #ifndef __linux__ before line 57 or move those 3 imports to #ifdef __FreeBSD__ and duplicate it at #if defined(__NetBSD__) || defined (__OpenBSD__) ?
Comment 8 Landry Breuil editbugs 2019-01-25 08:05:00 CET
adding #ifndef __linux__
#if HAVE_SYSCTL
around where they were before is fine :)

thanks !
Comment 9 Git Bot editbugs 2019-02-06 01:48:13 CET
Andre Miranda referenced this bugreport in commit 968b75c514faedb18181f8c628a334af8229b02e

Restore headers for *BSD (Bug #15039)

https://git.xfce.org/panel-plugins/xfce4-battery-plugin/commit?id=968b75c514faedb18181f8c628a334af8229b02e

Bug #15039

Reported by:
Yves-Alexis Perez
Reported on: 2019-01-14
Last modified on: 2019-02-06

People

Assignee:
Xfce-Goodies Maintainers
CC List:
2 users

Version

Attachments

headers.diff (380 bytes, patch)
2019-01-23 01:11 CET , Andre Miranda
landry : review+

Additional information