mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Cleaned up the OS4 build makefile, losing redundant libraries, adding more startup object code and ultimatively making the whole rebuild logic work again: if code changes and dependencies are set up correctly, it will now get rebuilt. Previously, such changes went unnoticed and you had to rebuild the entire library from scratch. - Added stubs for CreatePort(), DeletePort(), CreateTask(), DeleteTask() and NewList() which have equivalents in exec.library V50 but for which it might be useful if ported code didn't have to reference these explicitly. - mktemp() was broken in libunix.a with Unix path semantics enabled. This was because the name template was translated and translated back again, overwriting the translation buffer. This, funny enough, broke Samba's printing feature. Fixed by translating the name only before each test for "uniqueness" is made. The new code also handles empty "" templates gracefully, which was a problem with both the "standard" and the Unix path semantics flavour. Why is it that I find bugs like this always after having just released another library update? git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14769 87f5fb63-7c3d-0410-a384-fd976d0f7a62
76 lines
2.3 KiB
C
76 lines
2.3 KiB
C
/*
|
|
* $Id: amiga_createport.c,v 1.2 2004-11-13 12:55:39 obarthel Exp $
|
|
*
|
|
* :ts=4
|
|
*
|
|
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
|
* Copyright (c) 2002-2004 by Olaf Barthel <olsen@sourcery.han.de>
|
|
* All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
*
|
|
* - Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
*
|
|
* - Neither the name of Olaf Barthel nor the names of contributors
|
|
* may be used to endorse or promote products derived from this
|
|
* software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
*/
|
|
|
|
#include <string.h>
|
|
|
|
/****************************************************************************/
|
|
|
|
#include <proto/exec.h>
|
|
#include <clib/alib_protos.h>
|
|
|
|
/****************************************************************************/
|
|
|
|
#include "debug.h"
|
|
|
|
/****************************************************************************/
|
|
|
|
#if defined(CreatePort)
|
|
#undef CreatePort
|
|
#endif /* CreatePort */
|
|
|
|
/****************************************************************************/
|
|
|
|
struct MsgPort *
|
|
CreatePort(CONST_STRPTR name, LONG pri)
|
|
{
|
|
struct MsgPort * result = NULL;
|
|
|
|
assert( -128 <= pri && pri <= 127 );
|
|
|
|
if(pri < -128 || pri > 127)
|
|
goto out;
|
|
|
|
result = CreateMsgPort();
|
|
if(result != NULL && name != NULL)
|
|
{
|
|
result->mp_Node.ln_Name = (char *)name;
|
|
result->mp_Node.ln_Pri = pri;
|
|
|
|
AddPort(result);
|
|
}
|
|
|
|
out:
|
|
|
|
return(result);
|
|
}
|