From owner-freebsd-current@FreeBSD.ORG Wed Oct 20 20:39:27 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E7D81065672 for ; Wed, 20 Oct 2010 20:39:27 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2022E8FC14 for ; Wed, 20 Oct 2010 20:39:26 +0000 (UTC) Received: by wyb38 with SMTP id 38so4310152wyb.13 for ; Wed, 20 Oct 2010 13:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=TpvMBhLDdYNuGLO8jBpVr2wGDULJxN1WGs1sS2QDaAY=; b=uBm00oE0gSn/m8Dqa4Pii8sAZ4RCsGx6ewbiA06VROSWXPKK7A7PpEkkM1q++bc/b6 jlaNUbViSyLjZZHV0XkDtKzYMsa3IyHq9qQT6QpgZAetyH0Mua38yZdrX42V1JFoi4HU PRyZIshHZZ2E1wFy7/YixQz6zGKh5ZW7mSFYM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Qr5G10IUgGpCsUtb/OfCttdCJdUGYipnNZHuEzJiCx37CIYG19MG2OjbTigl2TzKKG Ki3xCgKSzUsXGc5IY+P8633EeJ379iQzSkZo5PglEr9n/lHUb3xolenEoEpedxJPRc0i mljnIaYXjJBGKtdv2H/n2pmCC1SC66eXhrOXE= MIME-Version: 1.0 Received: by 10.216.35.74 with SMTP id t52mr8198436wea.41.1287607165600; Wed, 20 Oct 2010 13:39:25 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.135.67 with HTTP; Wed, 20 Oct 2010 13:39:25 -0700 (PDT) In-Reply-To: <20101020194547.GA94244@server.vk2pj.dyndns.org> References: <4CBCDD3A.9070404@delphij.net> <4CBD26B4.2020205@yandex.ru> <4CBDB17C.4040607@yandex.ru> <20101020194547.GA94244@server.vk2pj.dyndns.org> Date: Wed, 20 Oct 2010 13:39:25 -0700 X-Google-Sender-Auth: GnMktJOOfeNGO-EeUj5qs0l34bw Message-ID: From: Garrett Cooper To: Peter Jeremy Content-Type: text/plain; charset=ISO-8859-1 Cc: KOT MATPOCKuH , FreeBSD Current Subject: Re: [zfs] Mounting from (...) failed with error 19 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2010 20:39:27 -0000 On Wed, Oct 20, 2010 at 12:45 PM, Peter Jeremy wrote: > On 2010-Oct-20 10:50:38 +0400, KOT MATPOCKuH wrote: >>> I fixed it with attached patch. >>Omg... Why You are using strcmp, but not strncmp(fs, "zfs", strlen("zfs"))? > > Can you explain why you think it should be strncmp() please. I'd say that strcmp is perfectly fine because zfs is a 3 character (4 if you count NUL) string. The comparison logic is dang near the same: /* * Compare strings. */ int strcmp(const char *s1, const char *s2) { while (*s1 == *s2++) if (*s1++ == '\0') return (0); return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); } int strncmp(const char *s1, const char *s2, size_t n) { if (n == 0) return (0); do { if (*s1 != *s2++) return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); if (*s1++ == '\0') break; } while (--n != 0); return (0); } Weird how n == 0 with strcmp returns 0... -Garrett