Was verursacht Patch: **** Falsch geformter Patch in Zeile

1608
CIsForCookies

Ich habe eine diff-Datei erstellt. Ich versuche es auf einen anderen Zweig mit anzuwenden patch -p1 --dry-run < ~/patch_name(ich bin im 1. Verzeichnis - daher -p1), aber ich bekomme

patch: **** fehlerhafter patch in Zeile 45: diff --FILE_LOCATION ...

Bevor dieser Fehler auftrat, wurden diese Zeilen gedruckt.

checking file file_a checking file file_b 

Also, ich verstehe, dass das file_a, file_bok ist und dass ich ein Problem in Zeile 45 habe, also habe ich die Zeilen 45 am Ende der Datei gelöscht (ich habe es 2 mal gemacht - einmal ohne eine neue Zeile am Ende, einmal mit).

Nun ist der Fehler

patch: **** fehlerhafter patch in Zeile 44: diff --FILE_LOCATION ...

Was ist los mit diesem Patch?

Dies ist der Patch selbst:

diff --git a/trunk/rf_iss/ISS/code/future/inc/params.h b/trunk/rf_iss/ISS/code/future/inc/params.h index 1983556..16a8375 100755 --- a/trunk/rf_iss/ISS/code/future/inc/params.h +++ b/trunk/rf_iss/ISS/code/future/inc/params.h @@ -2348,6 +2348,7 @@ typedef UINT1 tLocalPortList [CONTEXT_PORT_LIST_SIZE]; #define MAX_SLI_SLL_NODES 1500 #define MAX_SLI_BUFF_BLOCKS 2 #define MAX_SLI_FD_ARR_BLOCKS 2 +#define MAX_SLI_WAKEUP 25 #define MAX_SLI_SDT_BLOCKS MAX_NO_OF_SOCKETS #define MAX_SLI_RAW_HASH_NODES MAX_NO_OF_SOCKETS #define MAX_SLI_RAW_RCV_Q_NODES MAX_NO_OF_SOCKETS diff --git a/trunk/rf_iss/ISS/code/future/netip/fsip/udp/src/udptskmg.c b/trunk/rf_iss/ISS/code/future/netip/fsip/udp/src/udptskmg.c index 9db6034..c5ac3ad 100755 --- a/trunk/rf_iss/ISS/code/future/netip/fsip/udp/src/udptskmg.c +++ b/trunk/rf_iss/ISS/code/future/netip/fsip/udp/src/udptskmg.c @@ -11,6 +11,7 @@  static VOID Udp_timer_expiry_handler PROTO ((VOID)); extern tMemPoolId gUdp4MemPoolId; +extern INT4 gi4SelectWakeupFd; /*-------------------------------------------------------------------+ * Function : Ip_Udp_Task_Init * @@ -191,6 +192,20 @@ udp_task_enqueue_to_applications_in_cxt (UINT4 u4ContextId, UINT2 u2Port, t_UDP * pUdpHdr) { t_UDP_TO_APP_MSG_PARMS *pParms = NULL; + + /* If queue is depleting reserved wakeupFd blocks drop packet */ + if (pCtrlBlk->i4SockDesc != gi4SelectWakeupFd) + { + if (MemGetFreeUnits (gUdp4MemPoolId) <= MAX_SLI_WAKEUP) + { + IP_CXT_TRC (u4ContextId, UDP_MOD_TRC, + ALL_FAILURE_TRC | CONTROL_PLANE_TRC, UDP_NAME, + "Packet Discarded since memory goes over reserved wakeup fd's\n"); + IP_RELEASE_BUF (pBuf, FALSE); + return IP_FAILURE; + } + }  pParms = (t_UDP_TO_APP_MSG_PARMS *) MemAllocMemBlk (gUdp4MemPoolId); if (pParms == NULL) diff --git a/trunk/rf_iss/ISS/code/future/sli/socket.c b/trunk/rf_iss/ISS/code/future/sli/socket.c index 1ca5641..2ad721f 100755 --- a/trunk/rf_iss/ISS/code/future/sli/socket.c +++ b/trunk/rf_iss/ISS/code/future/sli/socket.c @@ -3244,6 +3244,26 @@ SliSendtoWithTrace (INT4 i4SockDesc, CONST VOID *pi1Buf, INT4 i4BufLen, } cpPeerSdtSock = SOCK_DESC_TABLE[i4PeerSockDesc];  + /* check added to ensure that MAX_SLI_WAKEUP  + * units are reserved for WakeupFD socket. This is to  + * ensure wakeup fd is always protected such that once + * it gets notification, it will cleanup the filled + * udp queue. but wakeup fd could + * not be triggered because of lack of space in queue + * so explicitly reserve space for wakeup fd socket. + */ + if (i4SockDesc != gi4SelectWakeupFd) + { + if (MemGetFreeUnits (gUdp4MemPoolId) <= MAX_SLI_WAKEUP) + { + SLI_Release_Buffer (pBufChnHdr, FALSE); + CpsdtSock->i1ErrorCode = SLI_EMEMFAIL; + SLI_ERR (SLI_EMEMFAIL); + GiveSliProtectSem(CpsdtSock->ProtectSemId); + return SLI_FAILURE; + } + } +  /* allocate memory for UDP message from UDP4 mem pool */ pParms = (t_UDP_TO_APP_MSG_PARMS *) MemAllocMemBlk (gUdp4MemPoolId); if (pParms == NULL) 

Ich habe es mit erstellt, diffdamit ich nicht verstehe, wie es missgestaltet werden könnte ...

1
Ich habe keine Kristallkugel. Ihr Patch verstößt irgendwie gegen das erwartete Format, z. B. kein Platz vor unveränderten Zeilen. Stellen Sie dem Patch Ihre Frage, wenn Sie eine bessere Antwort benötigen. :-) mvw vor 6 Jahren 1
@mvw Ich habe den Patch hinzugefügt (nicht ~ 70 Zeilen) CIsForCookies vor 6 Jahren 0

0 Antworten auf die Frage