VirtualBox

Changeset 29648 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 18, 2010 4:15:42 PM (15 years ago)
Author:
vboxsync
Message:

Runtime: s/TASK_COMM_LEN/sizeof(current->comm)/ (fix debug builds on older Linux kernels)

Location:
trunk/src/VBox/Runtime/r0drv/linux
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c

    r28800 r29648  
    143143    long    lTimeout = cMillies == RT_INDEFINITE_WAIT ? MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(cMillies);
    144144#ifdef IPRT_DEBUG_SEMS
    145     snprintf(current->comm, TASK_COMM_LEN, "e%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
     145    snprintf(current->comm, sizeof(current->comm), "e%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
    146146#endif
    147147    for (;;)
     
    183183    finish_wait(&pThis->Head, &Wait);
    184184#ifdef IPRT_DEBUG_SEMS
    185     snprintf(current->comm, TASK_COMM_LEN, "e%lx:%d", IPRT_DEBUG_SEMS_ADDRESS(pThis), rc);
     185    snprintf(current->comm, sizeof(current->comm), "e%lx:%d", IPRT_DEBUG_SEMS_ADDRESS(pThis), rc);
    186186#endif
    187187    return rc;
  • trunk/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c

    r28800 r29648  
    167167    long    lTimeout = cMillies == RT_INDEFINITE_WAIT ? MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(cMillies);
    168168#ifdef IPRT_DEBUG_SEMS
    169     snprintf(current->comm, TASK_COMM_LEN, "E%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
     169    snprintf(current->comm, sizeof(current->comm), "E%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
    170170#endif
    171171    for (;;)
     
    207207    finish_wait(&pThis->Head, &Wait);
    208208#ifdef IPRT_DEBUG_SEMS
    209     snprintf(current->comm, TASK_COMM_LEN, "E%lx:%d", IPRT_DEBUG_SEMS_ADDRESS(pThis), rc);
     209    snprintf(current->comm, sizeof(current->comm), "E%lx:%d", IPRT_DEBUG_SEMS_ADDRESS(pThis), rc);
    210210#endif
    211211    return rc;
  • trunk/src/VBox/Runtime/r0drv/linux/semfastmutex-r0drv-linux.c

    r28800 r29648  
    115115
    116116#ifdef IPRT_DEBUG_SEMS
    117     snprintf(current->comm, TASK_COMM_LEN, "d%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
     117    snprintf(current->comm, sizeof(current->comm), "d%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
    118118#endif
    119119    down(&pThis->Semaphore);
    120120#ifdef IPRT_DEBUG_SEMS
    121     snprintf(current->comm, TASK_COMM_LEN, "o%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
     121    snprintf(current->comm, sizeof(current->comm), "o%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
    122122    AssertRelease(pThis->Owner == NIL_RTNATIVETHREAD);
    123123    ASMAtomicUoWriteSize(&pThis->Owner, RTThreadNativeSelf());
     
    143143    up(&pThis->Semaphore);
    144144#ifdef IPRT_DEBUG_SEMS
    145     snprintf(current->comm, TASK_COMM_LEN, "u%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
     145    snprintf(current->comm, sizeof(current->comm), "u%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis));
    146146#endif
    147147    return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h

    r28800 r29648  
    322322#ifdef IPRT_DEBUG_SEMS
    323323# define IPRT_DEBUG_SEMS_STATE(pThis, chState) \
    324     snprintf(current->comm, TASK_COMM_LEN, "%c%lx", (chState), IPRT_DEBUG_SEMS_ADDRESS(pThis));
     324    snprintf(current->comm, sizeof(current->comm), "%c%lx", (chState), IPRT_DEBUG_SEMS_ADDRESS(pThis));
    325325#else
    326326# define IPRT_DEBUG_SEMS_STATE(pThis, chState)  do {  } while (0)
     
    333333#ifdef IPRT_DEBUG_SEMS
    334334# define IPRT_DEBUG_SEMS_STATE_RC(pThis, chState, rc) \
    335     snprintf(current->comm, TASK_COMM_LEN, "%c%lx:%d", (chState), IPRT_DEBUG_SEMS_ADDRESS(pThis), rc);
     335    snprintf(current->comm, sizeof(current->comm), "%c%lx:%d", (chState), IPRT_DEBUG_SEMS_ADDRESS(pThis), rc);
    336336#else
    337337# define IPRT_DEBUG_SEMS_STATE_RC(pThis, chState, rc)  do {  } while (0)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette