kopia lustrzana https://gitlab.com/sane-project/website
83 wiersze
3.3 KiB
HTML
83 wiersze
3.3 KiB
HTML
<!-- received="Mon Apr 19 04:52:55 1999 PDT" -->
|
|
<!-- sent="Mon, 19 Apr 1999 13:55:53 +0200" -->
|
|
<!-- name="Petter Reinholdtsen" -->
|
|
<!-- email="pere@hungry.com" -->
|
|
<!-- subject="Avoid duplicate net devices" -->
|
|
<!-- id="199904191155.NAA00598@lee.Cc.Uit.No" -->
|
|
<!-- inreplyto="" -->
|
|
<title>sane-devel: Avoid duplicate net devices</title>
|
|
<h1>Avoid duplicate net devices</h1>
|
|
<b>Petter Reinholdtsen</b> (<a href="mailto:pere@hungry.com"><i>pere@hungry.com</i></a>)<br>
|
|
<i>Mon, 19 Apr 1999 13:55:53 +0200</i>
|
|
<p>
|
|
<ul>
|
|
<li> <b>Messages sorted by:</b> <a href="date.html#253">[ date ]</a><a href="index.html#253">[ thread ]</a><a href="subject.html#253">[ subject ]</a><a href="author.html#253">[ author ]</a>
|
|
<!-- next="start" -->
|
|
<li> <b>Next message:</b> <a href="0254.html">Petter Reinholdtsen: "Sane 1.01pre5 works (HP/UX 10.20, Irix 6.5 and RedHat Linux 5.2)"</a>
|
|
<li> <b>Previous message:</b> <a href="0252.html">Petter Reinholdtsen: "Artec URL patch for sane 1.01pre5"</a>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
</ul>
|
|
<!-- body="start" -->
|
|
I finally made SANE 1.01pre5 work on SGI Irix. No bugs, it just<br>
|
|
happends to read net.conf from current directory, not where the<br>
|
|
correct one was installed with the host list... Stupid me... :-)<br>
|
|
<p>
|
|
Anyway. While testing, I discovered that the net backend accepts<br>
|
|
duplicate hosts, and calls the same host multiple times. Here is a<br>
|
|
patch to avoid that.<br>
|
|
<p>
|
|
diff -ru src-pre1.0.1r5/backend/net.c src-pre1.0.1r5-sgi4i6/backend/net.c<br>
|
|
--- src-pre1.0.1r5/backend/net.c Sat Apr 3 06:43:01 1999<br>
|
|
+++ src-pre1.0.1r5-sgi4i6/backend/net.c Mon Apr 19 13:50:43 1999<br>
|
|
@@ -84,6 +84,15 @@<br>
|
|
static Net_Scanner *first_handle;<br>
|
|
static int saned_port;<br>
|
|
<p>
|
|
+static SANE_Bool<br>
|
|
+device_already_in_list(Net_Device *current, SANE_String_Const host)<br>
|
|
+{<br>
|
|
+ for ( ; NULL != current; current = current->next )<br>
|
|
+ if (0 == strcasecmp(host, current->name) )<br>
|
|
+ return SANE_TRUE;<br>
|
|
+ return SANE_FALSE;<br>
|
|
+}<br>
|
|
+<br>
|
|
static SANE_Status<br>
|
|
add_device (const char *name, Net_Device **ndp)<br>
|
|
{<br>
|
|
@@ -91,6 +100,11 @@<br>
|
|
Net_Device *nd;<br>
|
|
<p>
|
|
DBG(1, "adding backend %s\n", name);<br>
|
|
+<br>
|
|
+ /* Avoid adding the same device more then once */<br>
|
|
+ if (device_already_in_list(first_device, name)) {<br>
|
|
+ return SANE_STATUS_GOOD;<br>
|
|
+ }<br>
|
|
<p>
|
|
he = gethostbyname (name);<br>
|
|
if (!he)<br>
|
|
<p>
|
|
This change is almost identical to the similar snapscan patch.<br>
|
|
<pre>
|
|
--
|
|
##> Petter Reinholdtsen <## | <a href="mailto:pere@td.org.uit.no">pere@td.org.uit.no</a>
|
|
O- <SCRIPT Language="Javascript">window.close()</SCRIPT>
|
|
<a href="http://www.hungry.com/~pere/">http://www.hungry.com/~pere/</a> | Go Mozilla, go! Go!
|
|
<p>
|
|
<pre>
|
|
--
|
|
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
|
|
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
|
|
</pre>
|
|
<!-- body="end" -->
|
|
<p>
|
|
<ul>
|
|
<!-- next="start" -->
|
|
<li> <b>Next message:</b> <a href="0254.html">Petter Reinholdtsen: "Sane 1.01pre5 works (HP/UX 10.20, Irix 6.5 and RedHat Linux 5.2)"</a>
|
|
<li> <b>Previous message:</b> <a href="0252.html">Petter Reinholdtsen: "Artec URL patch for sane 1.01pre5"</a>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
</ul>
|