Skip to content

Commit fabc60c

Browse files
Merge pull request #1160 from vojtechtrefny/master_s390-fix-string-comparison
s390: Fix string comparison in bd_s390_zfcp_scsi_offline
2 parents 625c894 + 0e2157b commit fabc60c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plugins/s390.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ gboolean bd_s390_zfcp_scsi_offline (const gchar *devno, const gchar *wwpn, const
812812
g_propagate_error (error, l_error);
813813
return FALSE;
814814
}
815+
g_strchomp (fcphbasysfs);
815816
fclose (fd);
816817
g_free (hba_path);
817818

@@ -843,6 +844,7 @@ gboolean bd_s390_zfcp_scsi_offline (const gchar *devno, const gchar *wwpn, const
843844
g_propagate_error (error, l_error);
844845
return FALSE;
845846
}
847+
g_strchomp (fcpwwpnsysfs);
846848
fclose (fd);
847849
g_free (wwpn_path);
848850

@@ -876,14 +878,15 @@ gboolean bd_s390_zfcp_scsi_offline (const gchar *devno, const gchar *wwpn, const
876878
g_propagate_error (error, l_error);
877879
return FALSE;
878880
}
881+
g_strchomp (fcplunsysfs);
879882
fclose (fd);
880883
g_free (lun_path);
881884
g_free (fcpsysfs);
882885

883886
/* make sure read values align with expected values */
884887
scsidel = g_strdup_printf ("%s/%s/delete", scsidevsysfs, scsidev);
885888
scsidel = g_strchomp (scsidel);
886-
if ((fcphbasysfs == devno) && (fcpwwpnsysfs == wwpn) && (fcplunsysfs == lun)) {
889+
if (g_strcmp0 (fcphbasysfs, devno) == 0 && g_strcmp0 (fcpwwpnsysfs, wwpn) == 0 && g_strcmp0 (fcplunsysfs, lun) == 0) {
887890
fd = fopen (scsidel, "w");
888891
if (!fd) {
889892
g_set_error (&l_error, BD_S390_ERROR, BD_S390_ERROR_DEVICE,

0 commit comments

Comments
 (0)