From: Oliver Kurth Date: Wed, 7 Feb 2018 00:32:38 +0000 (-0800) Subject: Hgfs Server: replace duplicate function usage with a common function. X-Git-Tag: stable-10.3.0~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d55cc529267b0b385fc9d4453075d023c789e46f;p=thirdparty%2Fopen-vm-tools.git Hgfs Server: replace duplicate function usage with a common function. This change simply replaces a duplicate function usage with a common function and removes the duplicate one. --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index ea9d48180..799e011e9 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2018 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -349,7 +349,6 @@ static HgfsHandle HgfsFileNode2Handle(HgfsFileNode const *fileNode); static HgfsFileNode *HgfsHandle2FileNode(HgfsHandle handle, HgfsSessionInfo *session); static void HgfsServerExitSessionInternal(HgfsSessionInfo *session); -static Bool HgfsIsShareRoot(char const *cpName, size_t cpNameSize); static void HgfsServerCompleteRequest(HgfsInternalStatus status, size_t replyPayloadSize, HgfsInputParam *input); @@ -8212,7 +8211,7 @@ HgfsServerGetattr(HgfsInputParam *input) // IN: Input params * Replace it with a more appropriate error code: no such device. */ if (status == HGFS_ERROR_FILE_NOT_FOUND && - HgfsIsShareRoot(cpName, cpNameSize)) { + HgfsServerIsSharedFolderOnly(cpName, cpNameSize)) { status = HGFS_ERROR_IO; } } @@ -9390,38 +9389,6 @@ exit: } -/* - *----------------------------------------------------------------------------- - * - * HgfsIsShareRoot -- - * - * Checks if the cpName represents the root directory for a share. - * Components in CPName format are separated by NUL characters. - * CPName for the root of a share contains only one component thus - * it does not have any embedded '\0' characters in the name. - * - * Results: - * TRUE if it is the root directory, FALSE otherwise. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -static Bool -HgfsIsShareRoot(char const *cpName, // IN: name to test - size_t cpNameSize) // IN: length of the name -{ - size_t i; - for (i = 0; i < cpNameSize; i++) { - if (cpName[i] == '\0') { - return FALSE; - } - } - return TRUE; -} - /* * more testing */