Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
udisks2.7671
0001-Remove-leading-trailing-white-space-in-rea...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Remove-leading-trailing-white-space-in-read_sysfs_at.patch of Package udisks2.7671
From 50821bf8de0484a62568c6912bd1e83c3d4a3060 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny <vtrefny@redhat.com> Date: Mon, 16 Oct 2017 12:41:22 +0200 Subject: [PATCH] Remove leading/trailing white space in 'read_sysfs_attr' So we don't have to call 'g_strstrip' after using it. Related: rhbz#1400056 (cherry picked and ported from commit 61ff342139f21663958bcc2972a3efa37cf7bc83) --- src/udiskslinuxmdraid.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/udiskslinuxmdraid.c b/src/udiskslinuxmdraid.c index eefaef7b..ece58abf 100644 --- a/src/udiskslinuxmdraid.c +++ b/src/udiskslinuxmdraid.c @@ -143,6 +143,10 @@ read_sysfs_attr (GUdevDevice *device, goto out; } + /* remove newline from the attribute */ + if (ret != NULL) + g_strstrip (ret); + out: g_free (path); return ret; @@ -394,14 +398,8 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, /* Can't use GUdevDevice methods as they cache the result and these variables vary */ degraded = read_sysfs_attr_as_int (raid_device->udev_device, "md/degraded"); sync_action = read_sysfs_attr (raid_device->udev_device, "md/sync_action"); - if (sync_action != NULL) - g_strstrip (sync_action); sync_completed = read_sysfs_attr (raid_device->udev_device, "md/sync_completed"); - if (sync_completed != NULL) - g_strstrip (sync_completed); bitmap_location = read_sysfs_attr (raid_device->udev_device, "md/bitmap/location"); - if (bitmap_location != NULL) - g_strstrip (bitmap_location); } if (has_stripes) @@ -545,7 +543,6 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, member_state = read_sysfs_attr (raid_device->udev_device, buf); if (member_state != NULL) { - g_strstrip (member_state); member_state_elements = g_strsplit (member_state, ",", 0); } else @@ -559,7 +556,6 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, member_slot = read_sysfs_attr (raid_device->udev_device, buf); if (member_slot != NULL) { - g_strstrip (member_slot); if (g_strcmp0 (member_slot, "none") != 0) member_slot_as_int = atoi (member_slot); } -- 2.16.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor