List Info

Thread: LAM: FreeBSD Port: net/lam7




LAM: FreeBSD Port: net/lam7
user name
2006-05-17 23:04:34
Hi Jan and Lam developers;

I found a building problem while building lam7.1.1 on 
FreeBSD-6.1-Release: lam has a function called strtonum in 
share/args/all_opt.c. this function conflicts with
strtonum(3), a BSD 
extension taken from OpenBSD.

The attached patch builds lam for me again: I just renamed
the function, 
can you please verify it?

regards,

    Pedro.
--- share/args/all_opt.c.orig	Wed May 17 17:49:22 2006
+++ share/args/all_opt.c	Wed May 17 17:50:07 2006
 -33,7
+33,7 
 static int addinst(struct ao_opt *opt, int nparam, char
**params);
 static int countparam(OPT *aod, struct ao_opt *opt, char
**argv);
 static int mutexchk(struct ao_opt *opt);
-static int strtonum(const char *str, int *pnum);
+static int istrtonum(const char *str, int *pnum);
 static struct ao_opt *findopt(OPT *desc, const char
*optstr);
 
 
 -652,7
+652,7 
 /*
  * If a number, assume '#' option.
  */
-		else if (strtonum(++str, &num) == 0) {
+		else if (istrtonum(++str, &num) == 0) {
 
 			popt = findopt(aod, "#");
 			if ((popt == 0) || (mutexchk(popt))) {
 -884,7
+884,7 
 
 
 /*
- *	strtonum
+ *	istrtonum
  *
  *	Function:	- convert string to number if possible
  *			- handles decimal/octal/hexadecimal
 -894,7
+894,7 
  *	Returns:	- 0 or LAMERROR
  */
 static int
-strtonum(const char *str, int *pnum)
+istrtonum(const char *str, int *pnum)
 {
 	char		*endstr;		/* end of parsed string */
 
 -956,7
+956,7 
 
 		if (strcmp(string, "--") == 0) break;
 
-		if ((strtonum(string + 1, &num) == 0) &&
+		if ((istrtonum(string + 1, &num) == 0) &&
 				(findopt(aod, "#") != 0)) break;
 
 		if (findopt(aod, string + 1)) break;
 -1036,7
+1036,7 
 	for (; nparam > 0; --nparam, ++params, parmbuf += size)
{
 
 		if (fl_int) {
-			if (strtonum(*params, &num)) {
+			if (istrtonum(*params, &num)) {
 				errno = EUSAGE;
 				return(LAMERROR);
 			}
_______________________________________________
This list is archived at http://www.l
am-mpi.org/MailArchives/lam/
LAM: FreeBSD Port: net/lam7
user name
2006-05-18 14:45:17
On May 17, 2006, at 7:04 PM, Pedro F. Giffuni wrote:

> Hi Jan and Lam developers;
>
> I found a building problem while building lam7.1.1 on
FreeBSD-6.1- 
> Release: lam has a function called strtonum in
share/args/ 
> all_opt.c. this function conflicts with strtonum(3), a
BSD  
> extension taken from OpenBSD.
>
> The attached patch builds lam for me again: I just
renamed the  
> function, can you please verify it?

Other than naming the function lam_strtonum instead of
isstrtonum,  
your patch looks good.  I'll commit it to the SVN
repository, and it  
will eventually be in LAM 7.1.3.

Brian


-- 
   Brian Barrett
   LAM/MPI developer and all around nice guy
   Have a LAM/MPI day: http://www.lam-mpi.org/


_______________________________________________
This list is archived at http://www.l
am-mpi.org/MailArchives/lam/
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )