[svn-commits] tzafrir: branch tools/tzafrir/sysfs r8659 - in /tools/team/tzafrir/sysfs: ./ ...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon May 17 17:55:03 CDT 2010


Author: tzafrir
Date: Mon May 17 17:55:00 2010
New Revision: 8659

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8659
Log:
Avoid span numbers with a leading 0:

span numbers with leading zero are parsed by dahdi_cfg as octal ("%i").
- Make sure span number are not zero padded since we use them in
  dahdi_pools to generate spanmap
- Prevent 0 numbered span.

Modified:
    tools/team/tzafrir/sysfs/dahdi_cfg.c
    tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm

Modified: tools/team/tzafrir/sysfs/dahdi_cfg.c
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/sysfs/dahdi_cfg.c?view=diff&rev=8659&r1=8658&r2=8659
==============================================================================
--- tools/team/tzafrir/sysfs/dahdi_cfg.c (original)
+++ tools/team/tzafrir/sysfs/dahdi_cfg.c Mon May 17 17:55:00 2010
@@ -361,7 +361,7 @@
 		return -1;
 	}
 	span = span_string2num(realargs[0]);
-	if (span < 0) {
+	if (span <= 0) {
 		error("Span number should be a valid span number, not '%s'\n", realargs[0]);
 		return -1;
 	}

Modified: tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm?view=diff&rev=8659&r1=8658&r2=8659
==============================================================================
--- tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm (original)
+++ tools/team/tzafrir/sysfs/xpp/perl_modules/Dahdi/Span.pm Mon May 17 17:55:00 2010
@@ -309,9 +309,8 @@
 	my $dev_dir = shift or die "Missing sysfs path parameter\n";
 	$dev_dir =~ m{.*/span-(\d+)$};
 	my $num = $1;
-	my $num_str = sprintf "%03d", $num;
 	defined($num) or die "can't figure span number from $dev_dir\n";
-	my $self = { NUM => $num, DEV_DIR => $dev_dir };
+	my $self = { NUM => $num + 0, DEV_DIR => $dev_dir };
 	bless $self, $pack;
 	my @xpds = Dahdi::Xpp::Xpd::xpds_by_spanno;
 	my $xpd = $xpds[$num];




More information about the svn-commits mailing list