From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 21:01:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56E521065687; Tue, 21 Aug 2012 21:01:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACFC78FC12; Tue, 21 Aug 2012 21:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LL1OFE005240; Tue, 21 Aug 2012 21:01:24 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LL1Oi1005237; Tue, 21 Aug 2012 21:01:24 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208212101.q7LL1Oi1005237@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 21 Aug 2012 21:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239535 - stable/8/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 21:01:25 -0000 Author: pfg Date: Tue Aug 21 21:01:24 2012 New Revision: 239535 URL: http://svn.freebsd.org/changeset/base/239535 Log: MFC r238509: Use libc's strndup() instead of Dtrace's reimplementation. Corresponds partially to OpenSolaris change: PSARC 2010/299 GNU/Linux/BSD compatibility functions 6901783 strndup would be nice. Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Tue Aug 21 21:00:33 2012 (r239534) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Tue Aug 21 21:01:24 2012 (r239535) @@ -29,23 +29,6 @@ #include #include -#include - -/* - * Create a copy of string s, but only duplicate the first n bytes. - */ -char * -strndup(const char *s, size_t n) -{ - char *s2 = malloc(n + 1); - - if (s2 == NULL) - longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); - - (void) strncpy(s2, s, n); - s2[n] = '\0'; - return (s2); -} /* * Transform string s inline, converting each embedded C escape sequence string Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Tue Aug 21 21:00:33 2012 (r239534) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Tue Aug 21 21:01:24 2012 (r239535) @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,14 +19,12 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _DT_STRING_H #define _DT_STRING_H -#pragma ident "%Z%%M% %I% %E% SMI" #include #include @@ -36,7 +33,6 @@ extern "C" { #endif -extern char *strndup(const char *, size_t); extern size_t stresc2chr(char *); extern char *strchr2esc(const char *, size_t); extern const char *strbasename(const char *);