components/gparted/patches/2.gparted-01-solaris.patch
author Niveditha Rau <Niveditha.Rau@Oracle.COM>
Fri, 05 Aug 2016 08:57:09 +0000
changeset 6582 4fb5be1315a8
parent 5673 03a73b3209f6
permissions -rw-r--r--
24400201 gparted needs to be updated to work with an updated libsigc++

# Source: Internal
# Info: This patch fixes issues introduced in updated version of GParted 0.25.0 
# Status: This patch is Solaris specific.  Will not be sent upstream.
--- Original/GParted_Core.cc	2016-03-08 14:38:37.669910925 -0800
+++ gparted-0.25.0/src/GParted_Core.cc	2016-03-08 14:39:22.709951526 -0800
@@ -49,7 +49,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <dirent.h>
-#include <mntent.h>
+#include <sys/mnttab.h>
 #include <gtkmm/messagedialog.h>
 #include <gtkmm/main.h>
 
@@ -1049,19 +1049,20 @@
 	const Glib::ustring & filename,
 	std::map< Glib::ustring, std::vector<Glib::ustring> > & map )
 {
+	int i = 0;
 	FS_Info fs_info ;  //Use cache of file system information
 
-	FILE* fp = setmntent( filename .c_str(), "r" ) ;
+	FILE* fp = fopen( filename .c_str(), "r" ) ;
 
 	if ( fp == NULL )
 		return ;
 
-	struct mntent* p = NULL ;
+	struct mnttab* p = NULL ;
 
-	while ( (p = getmntent(fp)) != NULL )
+	while ( (i = getmntent(fp, p)) != NULL )
 	{
-		Glib::ustring node = p->mnt_fsname ;
-		Glib::ustring mountpoint = p->mnt_dir ;
+		Glib::ustring node = p->mnt_fstype ;
+		Glib::ustring mountpoint = p->mnt_mountp ;
 
 		Glib::ustring uuid = Utils::regexp_label( node, "^UUID=(.*)" ) ;
 		if ( ! uuid .empty() )
@@ -1075,7 +1076,7 @@
 			add_node_and_mountpoint( map, node, mountpoint ) ;
 	}
 
-	endmntent( fp ) ;
+	fclose( fp ) ;
 }
 
 void GParted_Core::add_node_and_mountpoint(
--- Original/main.cc	2016-03-07 15:23:50.265705094 -0800
+++ gparted-0.25.0/src/main.cc	2016-03-07 16:24:36.544239177 -0800
@@ -20,8 +20,16 @@
 #include <gtkmm/main.h>
 #include "../include/GParted_Core.h"
 
+#ifdef __sun
+char *program_name;
+#endif
+
 int main( int argc, char *argv[] )
 {
+#ifdef __sun
+	program_name = argv[0];
+#endif
+
 	//initialize thread system
 	Glib::thread_init() ;
 	GParted::GParted_Core::mainthread = Glib::Thread::self();
@@ -51,7 +59,10 @@
 	}
 
 	//deal with arguments..
-	std::vector<Glib::ustring> user_devices(argv + 1, argv + argc);
+	std::vector<Glib::ustring> user_devices;
+
+	for ( int t = 1; t < argc; t++)
+		user_devices.push_back(argv[t]);
 	
 	GParted::Win_GParted win_gparted( user_devices ) ; 
 	Gtk::Main::run( win_gparted ) ;