[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AUTOFIX patch and a question



In <01HW32ZI8M9G004OX6@CATHY.IJS.SI>,
Matija Grabnar (Matija.Grabnar@ijs.si) wrote:

>I seem to remember there was a way to determine the maximum ammount
>of memory to allocate to a single program, either in mint.cnf or in
>gem.cnf, but I can't find it now. Can anybody help me?

Try "MAXMEM=<amount in kb>" in MINT.CNF.

>Another problem is that AUTOFIX does not work if there is a "cd" command
>issued in mint.cnf, especialy if that command changes the current drive.
>Here is a patch that fixes that. My apologies if I've done it wrong, this
>is the first patch I've ever done :-)

Please create a *context diff* or a *unified diff* next time - if the
text already had other patches applied to it, it can be difficult
to find the correct source lines to modify otherwise...

>[patch deleted]

Your patch has one big problem: apparently it assumes that the
AUTO folder is *always* located on drive C: - which is not the
case if no harddrive is connected or if an alternative harddisk
driver is being used that allows booting from different harddisk
partitions...
(The drive letter in front of "\AUTO" was ommitted on purpose!)

Since I don't think that commands in MINT.CNF should be able to
*permanently* change the current drive and path (what for?), I've
got an alternative solution: drive and path are simply restored
after executing MINT.CNF...

--- ..\orig-src\main.c	Sun Jun 11 13:39:54 1995
+++ main.c	Fri Oct  6 00:05:36 1995
@@ -650,6 +651,7 @@
 					/* welcome.c */
 	static char buf[SPRINTF_MAX];
 	static char curpath[128];
+	int curdrive ;
 	long yn;
 	FILEPTR *f;

@@ -791,6 +793,7 @@
  * the file systems are properly initialized
  */
 /* set the current directory for the current process */
+	curdrive = Dgetdrv() ;
 	Dgetpath(curpath, 0);
 	if (!*curpath) {
 		curpath[0] = '\\';
@@ -935,6 +938,10 @@

 /* load the configuration file */
 	load_config();
+
+/* restore current path and drive (might have been changed by MINT.CNF) */
+	d_setdrv(curdrive) ;
+	d_setpath(curpath) ;

 /* start system update daemon */
 	if (sync_time > 0) {

(BTW: I didn't really test this yet - but it compiles and links
without any (additional) errors or warnings...)

Martin

-- 
 Martin Koehling // NEW email address: mk@anuurn.ruhr.de