O que causa o patch: **** patch malformado na linha

1

Eu tenho um arquivo diff que eu criei. Eu tento aplicá-lo em outro ramo com patch -p1 --dry-run < ~/patch_name (eu estou no primeiro diretório - daí -p1 ), mas eu recebo

patch: **** malformed patch at line 45: diff --FILE_LOCATION...

Antes desse erro aparecer, essa linha foi impressa;

checking file file_a
checking file file_b

Então, eu entendo que file_a, file_b estão ok e que eu tenho um problema na linha 45, então eu deletei as linhas 45 para o fim do arquivo (eu fiz isso duas vezes - uma vez sem uma nova linha no final , uma vez com).

Agora o erro é

patch: **** malformed patch at line 44: diff --FILE_LOCATION...

O que há de errado com esse patch?

Este é o patch em si:

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)

Eu criei usando diff , então não entendi como poderia ser malformado ...

    
por CIsForCookies 07.01.2018 / 12:19

0 respostas